解决方案我的用户没有对pip目录拥有权限,我使用sudo -H标志重新安装了Python3.5
我正在尝试使用pip3安装Tensorflow for python3.5 --原因在这 github问题中描述--但是当我使用sudo pip3 install *.whl安装时,它会安装到python3.4。
如何将pip3重定向到python3.5目录中?
我在Ubuntu 14.04上跑
kendall@kendall-Macmini:~/Downloads$ python3.4 -m pip --version
pip 8.1.2 from /usr/local/lib/python3.4/dist-packages/pip-8.1.2-py3.4.egg (python 3.4)
kendall@kendall-Macmini:~/Downloads$ python3.5 -m pip --version
/usr/local/bin/python3.5: No module named pip看起来我甚至没有为python3.5安装pip。我该怎么做?
我试过了
kendall@kendall-Macmini:~/Downloads$ pip install -U pip
Requirement already up-to-date: pip in /usr/local/lib/python3.4/dist-packages/pip-8.1.2-py3.4.egg另外,
kendall@kendall-Macmini:~/Downloads$ whereis pip
pip: /usr/bin/pip /usr/bin/X11/pip /usr/local/bin/pip3.4 /usr/local/bin/pip /usr/local/bin/pip2.7 /usr/share/man/man1/pip.1.gz我找不到任何升级到pip3.5的支持
更新
kendall@kendall-Macmini:~/Downloads$ sudo apt-get install python3-setuptools
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-setuptools is already the newest version.
The following packages were automatically installed and are no longer required:
libntdb1 linux-headers-4.2.0-27 linux-headers-4.2.0-27-generic
linux-image-4.2.0-27-generic linux-image-extra-4.2.0-27-generic
linux-signed-image-4.2.0-27-generic python-ntdb
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
kendall@kendall-Macmini:~/Downloads$ sudo python3.5 easy_install.py pip
python3.5: can't open file 'easy_install.py': [Errno 2] No such file or directory
kendall@kendall-Macmini:~/Downloads$ python3.5 -m ensurepip
Ignoring ensurepip failure: pip 8.1.1 requires SSL/TLS
kendall@kendall-Macmini:~/Downloads$ sudo apt-get install pip3
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package pip3
kendall@kendall-Macmini:~/Downloads$ sudo apt-get install libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libssl-dev is already the newest version.
The following packages were automatically installed and are no longer required:
libntdb1 linux-headers-4.2.0-27 linux-headers-4.2.0-27-generic
linux-image-4.2.0-27-generic linux-image-extra-4.2.0-27-generic
linux-signed-image-4.2.0-27-generic python-ntdb
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
kendall@kendall-Macmini:~/Downloads$ python3.5 -m ensurepip
Ignoring ensurepip failure: pip 8.1.1 requires SSL/TLS由@fwalsh推荐
kendall@kendall-Macmini:~/Downloads$ python3.5 get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 19177, in <module>
main()
File "get-pip.py", line 194, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
import pip
zipimport.ZipImportError: can't decompress data; zlib not available好像我错过了各种各样的依赖--我要尝试重新安装
发布于 2016-07-07 16:12:14
检查: /usr/local/lib/python3.5/dist-packages
您可以使用Pip或easy_install( Pythons安装工具的一部分)来安装Pip:
sudo apt-get install python3-setuptools
sudo python3.5 easy_install.py pip或者你可以试试:
python3.5 -m ensurepip另一个选项是尝试从存储库安装,包名取决于您的发行版:
sudo apt-get install python3-pip pip3编辑:为了便于安装,尝试进行此更正:
sudo apt-get install python3-setuptools
sudo python3.5 /usr/local/lib/python3.5/dist-packages/easy_install.py pip我想这就是它安装到的目录。
此外,您还缺少了python3.5 -m ensurepip命令的这个库:
sudo apt-get install libssl-dev发布于 2021-08-30 22:50:46
所有不同的Python3.*版本似乎都重复使用相同的pip位置,因此很难调用特定的Python版本。
但是,可以通过将特定版本指定为模块来调用pip。因此,与其做:
pip3.5 install <blah>它不存在于大多数发行版中,请做:
python3.5 -m pip install <blah>发布于 2020-12-09 13:13:51
试一试
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.8 python3.8-dev python3.8-venv
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
python3 -Vhttps://stackoverflow.com/questions/38249961
复制相似问题