Using python 3.6 in a virtual environment created by python3 -m venv env_name
I need to use the python sip
module.
I activate the venv by source env_name/bin/activate
I install this successfully by pip install sip
which results in
Installing collected packages: packaging, sip
Successfully installed packaging-20.4 sip-5.4.0
Afterwards I can check that sip appears in pip by
$ pip list | grep sip
sip 5.4.0
After all of this I try to use sip by opening python and importing it with the following error:
$ python
Python 3.6.9 (default, Oct 8 2020, 12:12:24)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sip
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sip'
>>>
If I try the same outside the virtualenv it works fine, am I creating the virtualenv incorrectly?
edit: this is on ubuntu 18.04 LTS with python 3.6.9
Make sure you use
pip3
notpip
. So you need you basically runpip3 install sip