[英]Unable to install pip on Ubuntu 14.04
在我的Ubuntu 14.04機器上,當我嘗試安裝boto3時,我得到了
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in <module>
from pip import main
ImportError: No module named pip
然后我嘗試使用sudo apt install python-pip
,我得到了
Reading package lists... Done
Building dependency tree
Reading state information... Done
...
0 upgraded, 0 newly installed, 0 to remove and 130 not upgraded.
python get-pip.py
我懂了
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7.9/lib/python2.7/site-packages/pip'
Consider using the `--user` option or check the permissions.
我鏈接的網站是否是安裝pip的適當方法,如果可以,如何解決權限錯誤? 我正在使用python 2.7.9。
安裝conda(最好是miniconda,因為它比Anaconda更輕巧)。 您可以通過以下網站進行此操作: https : //docs.conda.io/en/latest/miniconda.html
注意,哪個操作系統以及32bit還是64bit。 例如Linux 32位
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86.sh
或Linux 64位
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
對於安裝,您需要執行以下操作:
bash Miniconda3-latest-Linux-x86.sh
要么
bash Miniconda3-latest-Linux-x86_64.sh
分別在終端中。 之后,在終端中以conda
開頭的任何命令都將起作用。
conda解決了您現在遇到的此類依賴性問題。
為這個東西創造一個有用的環境
conda create --name myenv
conda activate myenv # enter then newly created environment
然后,安裝pip非常簡單:
# the new environment e.g. here, <myenv>
conda install pip # this installs automatically newest Python and pip
# you could also do:
conda install git pip
# if you also want to pip install directly from github repositories
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.