小编Par*_*Pal的帖子

上下文版本冲突错误,Google colab

我正在尝试在 Google colab 上安装并运行 sunpy。它需要 astropy 版本 3.1 或更高版本的软件包。即使在安装 astropy 版本 3.2.1 后,当我导入 sunpy 时,它也会出现以下错误:

ContextualVersionConflict     Traceback (most recent call last)
 <ipython-input-10-1a62dedba559> in <module>()
   ----> 1 import sunpy

5 frames
/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py in 
resolve(self, requirements, env, installer, replace_conflicting, 
extras)
789                 # Oops, the "best" so far conflicts with a 
dependency
790                 dependent_req = required_by[req]
--> 791                 raise VersionConflict(dist, 
req).with_context(dependent_req)
792 
793             # push the new requirements onto the stack

ContextualVersionConflict: (astropy 3.0.5 
(/usr/local/lib/python3.6/dist-packages), 
Requirement.parse('astropy>=3.1'), {'sunpy'})
Run Code Online (Sandbox Code Playgroud)

pip list 给出以下结果:

Package                  Version              
------------------------ …
Run Code Online (Sandbox Code Playgroud)

google-colaboratory

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

google-colaboratory ×1