multiple python versions
Omer Zak
w1 at zak.co.il
Thu Jul 22 20:03:14 IDT 2021
You do not tell the 3.9.6 environment to reuse 3.8 directory modules.
The compiled code in 3.8 may be incompatible with your 3.9.6
interpreter.
Use pyenv and then use 'pip install' (under venv, it automatically
knows to use pip3 if you use any 3.x version). Do not use 'sudo'
because you are installing the module only for that virtualenv, not for
the entire system.
On Thu, 2021-07-22 at 19:51 +0300, Shlomo Solomon wrote:
> I guess I don't completely understand the concept after all. If I
> setup
> a virtual environment for 3.9.6, how would it "know" that modules are
> installed in the 3.8 directory? As I wrote in my original post,
> without
> a virtual environment, in 3.9.6 I get:
>
> > > > import scapy
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ModuleNotFoundError: No module named 'scapy'
>
> but the module does exist in 3.8:
>
> sudo pip3 install scapy
> Requirement already satisfied: scapy in
> /usr/local/lib/python3.8/dist-packages (2.4.4)
>
>
> So how do I tell the 3.9.6 environment to look for modules in the 3.8
> directory?
--
$ python
>>> type(type(type))
<type 'type'>
My own blog is at https://tddpirate.zak.co.il/
My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with
which I may be affiliated in any way.
WARNING TO SPAMMERS: at https://www.zak.co.il/spamwarning.html
More information about the Linux-il
mailing list