Ubuntu使用pip3命令安装Python包,出现错误:-bash: /usr/local/bin/pip3: /usr/bin/p...
source link: https://blog.popkx.com/bash-usr-local-bin-pip3-usr-bin-python3-bad-interpreter-No-such-file-or-directory/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Ubuntu使用pip3命令安装Python包,出现错误:-bash: /usr/local/bin/pip3: /usr/bin/python3: bad interpreter: No such file or directory
今天在Ubuntu上使用pip3
命令安装 Python 模块时,出现了下面的错误:
-bash: /usr/local/bin/pip3: /usr/bin/python3: bad interpreter: No such file or directory
从报错信息来看,是系统无法找到一些文件,并且给出了两个对象:pip3
和 python3
,使用 ls
命令分别检查这两个对象:
$ ls /usr/local/bin/pip3 -l
-rwxr-xr-x 1 root root 215 Sep 27 10:52 /usr/local/bin/pip3
可见pip3
命令是正常的,再检查python3
:
$ root@lcc:~# ls /usr/bin/python* -l
发现在/usr/bin
目录并没有python3
,问题找到了,解决方法也很简单,注意到该目录下有 python
链接指向 python3.5,所以执行下面的命令即可解决问题:
$ sudo cp /usr/bin/python /usr/bin/python3
现在再使用pip3
命令安装Python包,发现正常了。
问题解决。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK