pip3:未找到命令但已安装 python3-pip
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30993086/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
pip3: command not found but python3-pip is already installed
提问by Searene
I can't use pip3 though python3-pip has already been installed. How to solve the problem?
尽管已经安装了 python3-pip,但我无法使用 pip3。如何解决问题?
sudo pip3 install virtualenv
sudo: pip3: command not found
sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
采纳答案by Mox
Run
跑
locate pip3
it should give you a list of results like this
它应该给你一个这样的结果列表
/<path>/pip3
/<path>/pip3.x
go to /usr/local/bin to make a symbolic link to where your pip3 is located
转到 /usr/local/bin 以创建指向 pip3 所在位置的符号链接
ln -s /<path>/pip3.x /usr/local/bin/pip3
回答by Kumar
I had a similar issue. In my case, I had to uninstall and then reinstall pip3:
我有一个类似的问题。就我而言,我必须卸载然后重新安装 pip3:
sudo apt-get remove python3-pip
sudo apt-get install python3-pip
回答by roflmyeggo
Same issue on Fedora 23
. I had to reinstall python3-pip
to generate the proper pip3
folders in /usr/bin/
.
上同样的问题Fedora 23
。我必须重新安装python3-pip
才能pip3
在/usr/bin/
.
sudo dnf reinstall python3-pip
回答by user2394284
You can use python3 -m pip
as a synonym for pip3
. That has saved me a couple of times.
您可以python3 -m pip
用作 的同义词pip3
。这救了我几次。
回答by Neville Lusimba
There is no need to install virtualenv. Just create a workfolder and open your editor in it. Assuming you are using vscode,
无需安装 virtualenv。只需创建一个工作文件夹并在其中打开您的编辑器。假设您使用的是 vscode,
$mkdir Directory && cd Directory
$code .
It is the best way to avoid breaking Ubuntu/linux dependencies by messing around with environments. In case anything goes wrong, you can always delete that folder and begin afresh. Otherwise, messing up with the ubuntu/linux python environments could mess up system apps/OS (including the terminal). Then you can press shift+P and type python:select interpreter. Choose any version above 3. After that you can do
这是避免破坏 Ubuntu/linux 依赖项的最佳方式。如果出现任何问题,您可以随时删除该文件夹并重新开始。否则,弄乱 ubuntu/linux python 环境可能会弄乱系统应用程序/操作系统(包括终端)。然后你可以按 shift+P 并输入 python:select interpreter。选择3以上的任意版本。之后就可以了
$pip3 -v
It will display the pip version. You can then use it for installations as
它将显示 pip 版本。然后您可以将其用于安装
$pip3 install Library
回答by Mikhail Katulin
You can make symbolic link to you pip3:
你可以给你 pip3 建立符号链接:
sudo ln -s $(which pip3) /usr/bin/pip3
It helps me in RHEL 7.6
它在 RHEL 7.6 中对我有帮助
回答by nightlytrails
Probably pip3
is installed in /usr/local/bin/
which is not in the PATH of the sudo
(root) user.
Use this instead
可能pip3
安装的/usr/local/bin/
位置不在sudo
(root)用户的 PATH 中。改用这个
sudo /usr/local/bin/pip3 install virtualenv
回答by mutluergoz
For Kali, you must use this code after the update.
对于 Kali,您必须在更新后使用此代码。
$sudo python3 get-pip.py
or if you write this, it also works but not supported anymore. So don't use:
或者如果你写这个,它也可以工作,但不再受支持。所以不要使用:
$sudo python get-pip.py