[英]Python installation in custom directory (Linux): PIP not working
我已經在用戶目錄下的Linux機器中安裝了Python3.6.4,可以說/drive/username/Python3.6.4
我已經設置了路徑和別名,並且Python運行正常(即執行python3
使我處於正確的環境中, which python3
會在該環境中生成: /drive/username/Python3.6.4/bin/python3
)
問題出在pip
! 當我執行pip3
,我得到:
-bash: /username/Python3.6.4/bin/pip3: /usr/local/bin/python3.6: bad interpreter: No such file or directory
which pip3
給出的命令: /drive/username/Python3.6.4/bin/pip3
我想念什么?
在我的電腦上:
$ cat /usr/bin/pip3.6
#!/usr/bin/python
...
因此,我認為您的pip
具有#!/usr/local/bin/python3.6
。
嘗試重寫或:
/drive/username/Python3.6.4/bin/python3 -m ensurepip
它將在/drive/username/Python3.6.4/bin
目錄中產生正確的pip
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.