[英]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.