Installing pip3
Try python3 -m pip3 install pip
.
You may be trying to use Python2 to run pip3 and that's why you're seeing the error.
thegreatcoder
Updated on September 18, 2022Comments
-
thegreatcoder over 1 year
I had followed the instructions here to install pip3; I need it to install other python3 packages. I don't remember if I installed pip3 a long time before. After running
sudo apt install python3-pip
, I get the following as the output,Reading package lists... Done Building dependency tree Reading state information... Done python3-pip is already the newest version (8.1.1-2ubuntu0.4). The following packages were automatically installed and are no longer required: gyp libavdevice-ffmpeg56 libjs-inherits libjs-node-uuid libuv1-dev linux-headers-4.13.0-37 linux-headers-4.13.0-37-generic linux-headers-4.13.0-38 linux-headers-4.13.0-38-generic linux-headers-4.13.0-39 linux-headers-4.13.0-39-generic linux-headers-4.13.0-41 linux-headers-4.13.0-41-generic linux-headers-4.13.0-43 linux-headers-4.13.0-43-generic linux-headers-4.13.0-45 linux-headers-4.13.0-45-generic linux-headers-4.15.0-29 linux-headers-4.15.0-29-generic linux-image-4.13.0-37-generic linux-image-4.13.0-38-generic linux-image-4.13.0-39-generic linux-image-4.13.0-41-generic linux-image-4.13.0-43-generic linux-image-4.13.0-45-generic linux-image-4.15.0-29-generic linux-image-extra-4.13.0-37-generic linux-image-extra-4.13.0-38-generic linux-image-extra-4.13.0-39-generic linux-image-extra-4.13.0-41-generic linux-image-extra-4.13.0-43-generic linux-image-extra-4.13.0-45-generic linux-modules-4.15.0-29-generic linux-modules-extra-4.15.0-30-generic linux-signed-image-4.13.0-37-generic linux-signed-image-4.13.0-38-generic linux-signed-image-4.13.0-39-generic linux-signed-image-4.13.0-41-generic linux-signed-image-4.13.0-43-generic linux-signed-image-4.13.0-45-generic Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 236 not upgraded.
However, When I type
which pip3
, I do not get any output. Again, When I typedpip3 -V
, I get the following response:The program 'pip3' is currently not installed. You can install it by typing: sudo apt install python3-pip
I tried
dpkg -L python3-pip
and got the following as the output:/. /usr /usr/lib /usr/lib/python3 /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages/pip-8.1.1.egg-info /usr/lib/python3/dist-packages/pip-8.1.1.egg-info/PKG-INFO /usr/lib/python3/dist-packages/pip-8.1.1.egg-info/dependency_links.txt /usr/lib/python3/dist-packages/pip-8.1.1.egg-info/not-zip-safe /usr/lib/python3/dist-packages/pip-8.1.1.egg-info/requires.txt /usr/lib/python3/dist-packages/pip-8.1.1.egg-info/entry_points.txt /usr/lib/python3/dist-packages/pip-8.1.1.egg-info/top_level.txt /usr/lib/python3/dist-packages/pip /usr/lib/python3/dist-packages/pip/baseparser.py /usr/lib/python3/dist-packages/pip/__main__.py /usr/lib/python3/dist-packages/pip/req /usr/lib/python3/dist-packages/pip/req/req_set.py /usr/lib/python3/dist-packages/pip/req/req_install.py /usr/lib/python3/dist-packages/pip/req/__init__.py /usr/lib/python3/dist-packages/pip/req/req_file.py /usr/lib/python3/dist-packages/pip/req/req_uninstall.py /usr/lib/python3/dist-packages/pip/index.py /usr/lib/python3/dist-packages/pip/status_codes.py /usr/lib/python3/dist-packages/pip/utils /usr/lib/python3/dist-packages/pip/utils/setuptools_build.py /usr/lib/python3/dist-packages/pip/utils/appdirs.py /usr/lib/python3/dist-packages/pip/utils/outdated.py /usr/lib/python3/dist-packages/pip/utils/ui.py /usr/lib/python3/dist-packages/pip/utils/logging.py /usr/lib/python3/dist-packages/pip/utils/encoding.py /usr/lib/python3/dist-packages/pip/utils/deprecation.py /usr/lib/python3/dist-packages/pip/utils/__init__.py /usr/lib/python3/dist-packages/pip/utils/filesystem.py /usr/lib/python3/dist-packages/pip/utils/hashes.py /usr/lib/python3/dist-packages/pip/utils/build.py /usr/lib/python3/dist-packages/pip/compat /usr/lib/python3/dist-packages/pip/compat/dictconfig.py /usr/lib/python3/dist-packages/pip/compat/__init__.py /usr/lib/python3/dist-packages/pip/compat/ordereddict.py /usr/lib/python3/dist-packages/pip/models /usr/lib/python3/dist-packages/pip/models/index.py /usr/lib/python3/dist-packages/pip/models/__init__.py /usr/lib/python3/dist-packages/pip/vcs /usr/lib/python3/dist-packages/pip/vcs/bazaar.py /usr/lib/python3/dist-packages/pip/vcs/subversion.py /usr/lib/python3/dist-packages/pip/vcs/mercurial.py /usr/lib/python3/dist-packages/pip/vcs/__init__.py /usr/lib/python3/dist-packages/pip/vcs/git.py /usr/lib/python3/dist-packages/pip/cmdoptions.py /usr/lib/python3/dist-packages/pip/basecommand.py /usr/lib/python3/dist-packages/pip/commands /usr/lib/python3/dist-packages/pip/commands/completion.py /usr/lib/python3/dist-packages/pip/commands/install.py /usr/lib/python3/dist-packages/pip/commands/hash.py /usr/lib/python3/dist-packages/pip/commands/uninstall.py /usr/lib/python3/dist-packages/pip/commands/__init__.py /usr/lib/python3/dist-packages/pip/commands/list.py /usr/lib/python3/dist-packages/pip/commands/search.py /usr/lib/python3/dist-packages/pip/commands/show.py /usr/lib/python3/dist-packages/pip/commands/download.py /usr/lib/python3/dist-packages/pip/commands/wheel.py /usr/lib/python3/dist-packages/pip/commands/freeze.py /usr/lib/python3/dist-packages/pip/commands/help.py /usr/lib/python3/dist-packages/pip/_vendor /usr/lib/python3/dist-packages/pip/_vendor/__init__.py /usr/lib/python3/dist-packages/pip/operations /usr/lib/python3/dist-packages/pip/operations/__init__.py /usr/lib/python3/dist-packages/pip/operations/freeze.py /usr/lib/python3/dist-packages/pip/__init__.py /usr/lib/python3/dist-packages/pip/locations.py /usr/lib/python3/dist-packages/pip/pep425tags.py /usr/lib/python3/dist-packages/pip/exceptions.py /usr/lib/python3/dist-packages/pip/download.py /usr/lib/python3/dist-packages/pip/wheel.py /usr/share /usr/share/man /usr/share/man/man1 /usr/share/man/man1/pip3.1.gz /usr/share/doc /usr/share/doc/python3-pip /usr/share/doc/python3-pip/copyright /usr/bin /usr/bin/pip3 /usr/share/doc/python3-pip/changelog.Debian.gz
which implies that pip3 has been installed.
How do I resolve this issue?
Some more details: I have python 2.7 and python 3 installed in /usr/local/lib/. The python 2.7 has the following pip installations:
/usr/local/lib/python2.7/dist-packages/pip /usr/local/lib/python2.7/dist-packages/pip-10.0.0.dist-info /usr/local/lib/python2.7/dist-packages/pip-18.0.dist-info
while there is no pip3 installation in /usr/local/lib/python3.5/. There is only a pip installation in python3.
How do I resolve this issue?
-
Ravexina over 5 yearswhat is the output of
echo $PATH
? -
thegreatcoder over 5 years
/home/shuba/.local/share/umake/bin:/home/shuba/bin:/home/shuba/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
-
Ravexina over 5 yearsEverything seems okay in your PATH, what happens if you run pip like this:
/usr/bin/pip3 -V
? -
thegreatcoder over 5 yearsI get this:
/usr/bin/pip3 -V bash: /usr/bin/pip3: No such file or directory
-
Ravexina over 5 yearsrun:
sudo apt install --reinstall python3-pip
it might help. -
thegreatcoder over 5 yearsAfter running it, I get the output for
which pip3
asusr/bin/pip3
However, if I typepip3 -v
, I get this: [link] (pastebin.com/kbUECtCF) -
thegreatcoder over 5 yearsHow do I fix this issue?
-
Ravexina over 5 yearsI'm not sure what can be the cause of issue at all. but try installing:
sudo apt install python3-dev
-
thegreatcoder over 5 yearsI got the following output: pastebin.com/RyyDy4r4
-