【发布时间】:2019-09-03 21:54:43
【问题描述】:
我需要在 python3 中使用更新版本的 Scipy。
我尝试使用以下命令升级 pip3pip3 install --upgrade scipy --user
Pip3 报告它成功安装了 scipy-1.3.1(它还说它跳过了 numpy 升级)
Collecting scipy
Using cached https://files.pythonhosted.org/packages/7a/0e/371881e018d...
Requirement already satisfied, skipping upgrade: numpy>=1.13.3 in /usr/locallib/python3.5/dist-packages (from scipy) (1.17.0)
Installing collected packages: scipy
Successfully installed scipy-1.3.1
现在,当我导入 scipy 时,它是旧版本 (0.17.0)
>>> print(scipy.__version__)
0.17.0
我尝试重新安装 scipy(这次使用 sudo)
sudo pip3 install --upgrade scipy
但是 pip3 抱怨它无法卸载旧的 scipy,因为它是一个 distutil 包。
Collecting scipy
Downloading https://files.pythonhosted.org/packages/7a/0e/371881e018d...
100% |⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜| 25.1MB 895kB/s
Requirement already satisfied, skipping upgrade: numpy>=1.13.3 in /usr/locallib/python3.5/dist-packages (from scipy) (1.17.0)
Installing collected packages: scipy
Found existing installation: scipy 0.17.0
Cannot uninstall 'scipy'. It is a distutil installed project and thus we cannot accurately determine which files belong to it whicch would lead to only a partial uninstall.
我尝试使用 synaptic 包管理器删除 distutil 包。但是,为了卸载 synaptic 要求我删除其他依赖 scipy 的软件包。
其中一个包 ubuntu-mate-desktop 是我的 ubuntu 系统的一部分,我不想摆弄它。
请建议我如何在不破坏系统包的情况下安装(升级)scipy 和 numpy。
【问题讨论】:
-
不要将系统 Python 用于这些事情!
-
切勿发布代码、错误或输出的图像!
-
请勿发布代码、数据、错误消息等的图片。 - 复制或键入问题中的文本。 stackoverflow.com/help/how-to-ask 通常我会在我的 cmets 中包含该链接。我不知道为什么我以前没有。
标签: python-3.x numpy scipy ubuntu-16.04