I have Python 2.7 and 3.5 installed in my Ubuntu. I installed Pika.
Now I can import Pika only in Pyhton 2.7 and not in 3.5 . How can I import Pika from Python 3.5
I have aliased python=python3.5
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
JMH as you figured it out yourself:
pip3 install package
installs the package for python3 interpreter
pip install package
installs the package for python2 interpreter
As of yet, there is no way to install simultaneously for both interpreters using a single command. Hence use pip and pip3 accordingly.
Also it is unwise to alter python aliases. To invoke python3 interpreter use python3 command and for python2 just use python command.