安装pip以导入模块

问题描述 投票:4回答:3

我试图安装matplotlib和scipy到python,并使用pip这样做。但是,当我尝试使用pip install scipy --myuser安装scipy时,我收到了以下消息:

无效要求' - myuser'

以前我用pip安装了numpy

python get-pip.py —myuser

pip install numpy —myuser

这很好,所以我不确定这里的问题是什么。

这是令人沮丧的,因为我想从终端而不是从我的Windows桌面使用python。

python ubuntu matplotlib pip
3个回答
2
投票

您应该能够在不使用--myuser参数的情况下安装它。

sudo python3 -m pip install scipy
sudo python3 -m pip install matplotlib

或者一体化

sudo python3 -m pip install scipy matplotlib

3
投票

如果要安装到用户,请尝试以下提到的命令:

pip install --user scipy

这是pip命令的帮助:

pip install --help

  --user                      Install to the Python user install directory for
                              your platform. Typically ~/.local/, or
                              %APPDATA%\Python on Windows. (See the Python
                              documentation for site.USER_BASE for full
                              details.)

0
投票

试试这个:

sudo python3 -m pip install scipy matplotlib

© www.soinside.com 2019 - 2024. All rights reserved.