So, I installed virtualenv in ubuntu terminal. I installed using the following commands:
sudo apt install python3-virtualenv
pip install virtualenv
But when I try creating a new virtualenv using:
virtualenv -p python3 venv
I am getting the following error:
AttributeError: module 'virtualenv.create.via_global_ref.builtin.cpython.mac_os' has no attribute 'CPython2macOsArmFramework'
How can I solve it?
I had a similar experience. The reason for this is that I did it by installing two virtualenv with apt and pip3. This seems to be a known bug (See also here)
Another way a second (or third) instance of virtualenv might have come to your system is via sudo pip install.
So, to be sure you only have one version, you can remove all of them:
pip3 upip3 uninstall virtualenvninstall virtualenv
sudo pip3 uninstall virtualenv
sudo apt purge python3-virtualenv
...and then pick one and re-install it (my preference is userspace pip install virtualenv).
You don't need to use virtualenv. You can use this:
python3 -m venv ./some_env
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With