I have Python3 and Python2 and also pip
and pip3
for various python version package installation.
I want install a ZMQ library in Python 2 and 3, I did it in python2 as well with the following line:
sudo pip install zmq
But when I using pip3
for ZMQ installation on Python3 I have a problem:
$ pip3 install zmq
Collecting zmq
Collecting pyzmq (from zmq)
Using cached https://files.pythonhosted.org/packages/94/e8/6b39ec62b4f7821eeefd69e0c1ddfd56744cd6613f8216fc972cfc8d7765/pyzmq-17.1.0-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: pyzmq, zmq
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/zmq'
Consider using the `--user` option or check the permissions.
Then when I used sudo before pip3
:
$ sudo pip3 install zmq
sudo: pip3: command not found
[NOTE]:
$ pip --version
pip 18.0 from /home/benyamin/.local/lib/python3.6/site-packages/pip (python 3.6)
$ pip3 --version
pip 18.0 from /home/benyamin/.local/lib/python3.6/site-packages/pip (python 3.6)
$ which pip
/home/benyamin/.local/bin/pip
$ which pip3
/home/benyamin/.local/bin/pip3
$ sudo which pip
/usr/local/bin/pip
$ sudo which pip3
$ # no output
It seems that my pip
is for Python3.6!
Any help would be greatly appreciated.
First remove your local
pip
:Install it using
apt
:or for "python2":
then run:
you can also update
pip
using:Alternative solution is to creat an alias:
Open the terminal and type:
Create a symbolic link at
/home/benyamin/.local/bin/pip3
which references to file/usr/local/bin/pip3
.Check location of the pip3 executable file and pip3 version.
Install zmq.