首页 > 解决方案 > 在要求升级时删除 python2 Mac

问题描述

我尝试安装新的软件包,例如dtaleu8darts但也升级旧的软件包statsmodels和许多其他软件包,但没有成功,我收到以下消息:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python 
as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. 
More 
details about Python 2 support in pip can be found at 
https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove 
support for this functionality.
ERROR: Could not find a version that satisfies the requirement u8darts (from versions: none)
ERROR: No matching distribution found for u8darts

我也尝试使用pip3as 安装相同的软件包,并且我有 python3 并且可以。唯一的问题是,尽管我只在我的 IDE(Jupyter NotebookVScode)上使用 python3,但我无法导入它们。我现在正试图从我的系统中删除 python2,我正在努力。

标签: python-3.xmacospython-2.7macos-catalinau8darts

解决方案


我已经合并了 Anconda,我需要做的就是使用以下命令恢复为 bash:

chsh -s /bin/bash

然后重新安装 Anaconda 并选择家庭安装(确保您的opt文件夹不包含任何 anaconda 文件夹,您可以通过键入space bar和访问/opt

现在我可以安装我想要的所有软件包。没问题。


推荐阅读