You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I just got an Ubuntu 22.04 machine with Python 3.10 preinstalled. Work projects requires me to use Python 2.7 and 3.9.
Creating a virtual environment with 3.x versions seems to work just fine:
$ pyenv virtualenv 3.9.16 py39
$ pyenv versions
system
* 2.7.18 (set by /home/stzanos/.pyenv/version)
3.8.10
* 3.9.16 (set by /home/stzanos/.pyenv/version)
3.9.16/envs/py39
3.10.6
py39
However, when trying to create in 2.7:
$ pyenv virtualenv 2.7.18 py27
Traceback (most recent call last):
File "/home/stzanos/lib/python/site.py", line 73, in <module>
__boot()
File "/home/stzanos/lib/python/site.py", line 3, in __boot
import os
File "/home/stzanos/.pyenv/versions/2.7.18/envs/py27/lib/python2.7/os.py", line 49, in <module>
import posixpath as path
ImportError: No module named posixpath
error: failed to install pip via get-pip.py
Any idea why this is happening? I would like to work in a virtual environment which python -> Python 2.7.18 and python3 -> 3.9.16.
I'd like this in order to open my projects in PyCharm and being able to use both.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there, I just got an Ubuntu 22.04 machine with Python 3.10 preinstalled. Work projects requires me to use Python 2.7 and 3.9.
Creating a virtual environment with 3.x versions seems to work just fine:
However, when trying to create in 2.7:
Any idea why this is happening? I would like to work in a virtual environment which python -> Python 2.7.18 and python3 -> 3.9.16.
I'd like this in order to open my projects in PyCharm and being able to use both.
Beta Was this translation helpful? Give feedback.
All reactions