Fix Python – How to rename a virtualenv in Python?

I misspelled the name of the virtualenv while initializing it using:
$ virtualenv vnev

I actually intended to create the environment with the name venv.
Having tried to rename the vnev folder to venv, I find that this doesn’t provide much help. The name of the activate environment still renames the old vnev.
$ mv vnev venv
$ . venv/bin/activate

Fix Python – Can existing virtualenv be upgraded gracefully?

I have a virtualenv created for Python 2.5 and want to “upgrade” it to Python 2.6.
Here is how it was originally set up:
virtualenv –no-site-packages -p python2.5 myenv

I now run virtualenv in the same directory to upgrade:
virtualenv –no-site-packages -p python2.6 myenv

Not overwriting existing python script myenv/bin/python (you must u….

Fix Python – bash: mkvirtualenv: command not found

After following the instructions on Doug Hellman’s virtualenvwrapper post, I still could not fire up a test environment.
[mpenning@tsunami ~]$ mkvirtualenv test
-bash: mkvirtualenv: command not found
[mpenning@tsunami ~]$

It should be noted that I’m using WORKON_HOME that is not in my $HOME. I tried looking for /usr/local/bin/virtualenvwrapper.s….

Fix Python – Can I install Python windows packages into virtualenvs?

Virtualenv is great: it lets me keep a number of distinct Python installations so that different projects’ dependencies aren’t all thrown together into a common pile.
But if I want to install a package on Windows that’s packaged as a .exe installer, how can I direct it to install into the virtualenv? For example, I have pycuda-0.94rc.win32-py2.6…..

Fix Python – ModuleNotFoundError: No module named ‘distutils.core’

I’ve recently upgraded from Ubuntu 18.04 to 19.04 which has python 3.7. But I work on many projects using Python 3.6.
Now when I try to create a virtualenv with Python 36 in PyCharm, it raises:
ModuleNotFoundError: No module named ‘distutils.core’

I can’t figure out what to do.
I tried to install distutils:
milano@milano-PC:~$ sudo apt-get insta….

Fix Python – Problems with pip install numpy – RuntimeError: Broken toolchain: cannot link a simple C program

I’m trying to install numpy (and scipy and matplotlib) into a virturalenv.
I keep getting these errors though:
RuntimeError: Broken toolchain: cannot link a simple C program

Cleaning up…
Command python egg_info failed with error code 1

I have the command line tools for xcode installed
$ which g….

Fix Python – Revert the `–no-site-packages` option with virtualenv

I have created a virtualenv using the –no-site-packages option and installed lots of libraries. Now I would like to revert the –no-site-packages option and use also the global packages.
Can I do that without recreating the virtualenv?
More precisely:
I wonder what exactly happens when creating a virtualenv using the –no-site-packages option as ….