Python 版本冲突正在快速进行中
拜托,我用的是谷歌Colab和Python3 我在fastprogress中遇到版本冲突问题。我有以下代码:Python 版本冲突正在快速进行中,python,version-control,google-colaboratory,fast-ai,Python,Version Control,Google Colaboratory,Fast Ai,拜托,我用的是谷歌Colab和Python3 我在fastprogress中遇到版本冲突问题。我有以下代码: !curl -s https://course.fast.ai/setup/colab | bash import warnings warnings.filterwarnings('ignore') from fastai.vision import * from fastai.metrics import error_rate import fastai print(f'fastai
!curl -s https://course.fast.ai/setup/colab | bash
import warnings
warnings.filterwarnings('ignore')
from fastai.vision import *
from fastai.metrics import error_rate
import fastai
print(f'fastai: {fastai.__version__}')
print(f'cuda: {torch.cuda.is_available()}')
---------------------------------------------------------------------------
VersionConflict Traceback (most recent call last)
<ipython-input-17-01736c3668f8> in <module>()
1 import warnings
2 warnings.filterwarnings('ignore')
----> 3 from fastai.vision import *
4 from fastai.metrics import error_rate
5 import fastai
7 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
VersionConflict: (fastprogress 0.1.22 (/usr/local/lib/python3.6/dist-packages), Requirement.parse('fastprogress>=0.2.1'))
有人知道原因吗?我刚才也面临同样的问题。在我的例子中,奇怪的是,我可以在重新启动内核后成功导入 对于我来说,解决方案是首先从fastai.vision import*运行cel:from,然后运行其他单元格,例如: 从google.colab导入drive.mount(“/content/gdrive”, force_remount=True)root_dir=“/content/gdrive/My Drive/”base_dir= root_dir+'fastai-v3/'
我检查了fastai和fastprogress的版本。 截至今天(2019年12月31日),Colab已
- 法斯泰:1.0.59
- 快速进度:0.1.22
!curl-shttps://course.fast.ai/setup/colab |bash
将更新到
- 法斯泰:1.0.60
- fastprogress:0.2.1
操作时,fastai.vision仍会指向旧版本,而fastai.vision仍会前进到新版本
我从@Martian和@John的两个解决方案中发现的是
@Martian提供的解决方案,即当您遇到问题并重新运行导入行时,只需重新启动运行时…
,即可导入新版本
感谢@Martian,我访问了运行时菜单-重新启动运行时,然后我没有再次运行(!curl-s | bash)命令。从那时起,我的剧本成功了是的,直到现在没有其他解释。
Requirement already up-to-date: fastprogress in /usr/local/lib/python3.6/dist-packages (0.2.1)