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.
pip3 uninstall virtualenv
virtualenv my-python3
You don't need to use virtualenv. You can use this:
python3 -m venv ./some_env
First off, just one of
sudo apt install python3-virtualenv
pip install virtualenv
should do. You do not need the pip command if the apt installation worked.
Second, you should be able to create one where you can write:
edd@rob:/tmp$ mkdir venvdemo
edd@rob:/tmp$ cd venvdemo/
edd@rob:/tmp/venvdemo$ virtualenv -p python3 venv
created virtual environment CPython3.9.5.final.0-64 in 162ms
creator CPython3Posix(dest=/tmp/venvdemo/venv, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/edd/.local/share/virtualenv)
added seed packages: pip==20.3.4, pkg_resources==0.0.0, setuptools==44.1.1, wheel==0.34.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
edd@rob:/tmp/venvdemo$
edd@rob:/tmp/venvdemo$ ls -a
. .. venv
edd@rob:/tmp/venvdemo$ ls -a venv/
. .. bin .gitignore lib pyvenv.cfg
edd@rob:/tmp/venvdemo$
(and I did this on an Ubuntu machine).
Third, something is still very wrong because with Ubuntu you should not get an error message for CPython2macOsArmFramework.