由网友(我身上有wafi)分享简介:我正在尝试在Google CoLab上安装和运行SunPy。它需要一个Asty版本3.1或更高版本的软件包。即使在安装Astopy版本3.2.1之后,当我导入SunPy时,也会出现以下错误:ContextualVersionConflict Traceback (most recent call last)我正在尝试在Google CoLab上安装和运行SunPy。它需要一个Asty版本3.1或更高版本的软件包。即使在安装Astopy版本3.2.1之后,当我导入SunPy时,也会出现以下错误:
![关于window提示IP冲突的错误告别](https://p.xsw88.cn/allimgs/daicuo/20230903/1819.png)
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'})
pip列表显示以下结果:
Package Version
------------------------ ---------------------
absl-py 0.8.0
aioftp 0.13.0
aiohttp 3.6.1
alabaster 0.7.12
albumentations 0.1.12
altair 3.2.0
astor 0.8.0
astropy 3.2.1
![关于window提示IP冲突的错误告别](https://p.xsw88.cn/allimgs/daicuo/20230903/1819.png)
如何解决此问题?
推荐答案
手动安装astropy >= 3.1
太阳之前:
!pip install astropy>=3.1
!pip install sunpy
然后,使用Runtime->Restart Runtime菜单重新启动您的运行时以获取新的Astopy。最后,导入sunpy。
以下是一个工作示例: https://colab.research.google.com/drive/1741JFtJPq37S8oEzjzvANFWBbH3rQ4Oc
相关推荐
最新文章