15

Ubuntu使用pip3命令安装Python包,出现错误:-bash: /usr/local/bin/pip3: /usr/bin/p...

 3 years ago
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.
neoserver,ios ssh client

Ubuntu使用pip3命令安装Python包,出现错误:-bash: /usr/local/bin/pip3: /usr/bin/python3: bad interpreter: No such file or directory

发表于 2019-12-03 08:12:00   |   已被 访问: 2,996 次   |   分类于:   杂谈 , Python   |   暂无评论

今天在Ubuntu上使用pip3命令安装 Python 模块时,出现了下面的错误:

-bash: /usr/local/bin/pip3: /usr/bin/python3: bad interpreter: No such file or directory

从报错信息来看,是系统无法找到一些文件,并且给出了两个对象:pip3python3,使用 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
ls命令检查Python

ls命令检查Python

发现在/usr/bin目录并没有python3,问题找到了,解决方法也很简单,注意到该目录下有 python 链接指向 python3.5,所以执行下面的命令即可解决问题:

$ sudo cp /usr/bin/python /usr/bin/python3

现在再使用pip3命令安装Python包,发现正常了。

问题解决。

阅读更多:   杂谈 , Python


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK