Error creating virtualenv with Python3 - python

I'm working on Linux Mint 17 and I'm trying to create a new virtualenv with Python3 like this:
python3.6 -m venv env
And this is the error that I get:
Error: Command '['/home/ric/myprojs/django-example-channels/env/bin/python3.6', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
I've googled this error message but haven't managed to find anything too informative.
This is my pip version, in case it make any difference:
pip --version
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
I've been using Python2 for some time, but I'm new to Python3. I don't know what I may be missing.
UPDATE 1:
Answering #cezar's question, when I type  which python3 this is what I get:
$ which python3
/usr/bin/python3
UPDATE 2:
Answering #Chłop Z Lasu:
$ virtualenv -p python3.6 env
Running virtualenv with interpreter /usr/bin/python3.6
Using base prefix '/usr'
New python executable in /home/ric/myprojs/django-example-channels/example_channels/env/bin/python3.6
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 2328, in <module>
main()
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 713, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 925, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 1231, in install_python
shutil.copyfile(executable, py_executable)
File "/usr/lib/python3.6/shutil.py", line 104, in copyfile
raise SameFileError("{!r} and {!r} are the same file".format(src, dst))

The error indicates that virtualenv is trying to make an environment in your python path. therefore, you have to specify your virtualenv destination
virtualenv -p python3.6 /path/to/yourenv

For venv and python3.6 installing venv one can use below to fix the issue
sudo apt install python3.6-venv

You gotta install the venv via code bellow:
sudo apt install python3.6-venv

Expanding on the Answer Above:
The error indicates that virtualenv is trying to make an environment in your python path. therefore, you have to specify your virtualenv destination
Since -p is a flag equivalent to --python, you can also use.
$ virtualenv --python=python3.6 /path/to/yourenv
Or
$ virtualenv -p python3.6 /path/to/yourenv

Related

How to install and run virtualenv on MacOS correctly

Hi I'm a beginner of python, I don't remember when and how I installed python3.8 on my Macbook air, only knew the installed path:
% which python
/usr/bin/python
% which python3
/usr/local/bin/python3
The pip command cannot not be found but pip3 is ok. Today I want to install virtaulenv:
% sudo -H pip3 install virtualenv
WARNING: Ignoring invalid distribution - (/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages)
Successfully installed virtualenv-20.6.0
I can use "pip3 show virtualenv" to know the info:
% pip3 show virtualenv
Name: virtualenv
Version: 20.6.0
Summary: Virtual Python Environment builder
Home-page: https://virtualenv.pypa.io/
Author: Bernat Gabor
Author-email: gaborjbernat#gmail.com
License: MIT
Location: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
Requires: six, platformdirs, backports.entry-points-selectable, distlib, filelock
Required-by:
But when I use "virtualenv" I got command not found message then I "pip3 uninstall" it. I searched for this and got a tip to use "easy_install" to install virtualenv. After installed I can execute the command, but got some error message:
% virtualenv
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 6, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3241, in <module>
#_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3225, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 583, in _build_master
ws.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'importlib-resources>=1.0' distribution was not found and is required by virtualenv
It seems doesn't work and I try the "sudo pip3 uninstall virtualenv" to uninstall it successfully, but it seems not really be removed:
% which virtualenv
/usr/local/bin/virtualenv
I have no idea about this, could you help me? I just want to run virtualenv normally and create flask project ...
PS. I can "sudo pip3 install flask" and "pip3 show flask" but still cannot run flask cammand (command not found), what should I do?
Thanks a lot!
try being explicit in the version of python you are using and install using -m pip instead
python3 -m pip install virtualenv
python3 -m virtualenv venv # create a new venv in ./venv
source ./venv/bin/activate # activate your new venv
often times the pip/pip3 just isnt pointing at the same python version you think you are using... by using this technique you are sure to be using the correct python and pip

virtualenv looking in the wrong place for easy_install & other files

Somehow I screwed up my python 2.7 installation on my mac so I tried to reinstall with "brew install python". Now when I try to create a new virtualenv, it throws an error about not finding /bin/easy_install. easy_install is actually in /usr/local/bin/easy_install. If I symlink it to /bin, virtualenv fails with /bin/pip and so on - every file it's looking for is actually in /usr/local/bin not /bin
How can I permanently make virtualenv look in the right place: /usr/local/bin?
$ virtualenv env
New python executable in /Users/myusername/code/lambda/env/bin/python2.7
Also creating executable in /Users/myusername/code/lambda/env/bin/python
Installing setuptools, pip, wheel...
Complete output from command /Users/myusername/c...da/env/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel:
Ignoring indexes: https://pypi.python.org/simple
Collecting setuptools
Collecting pip
Collecting wheel
Installing collected packages: setuptools, pip, wheel
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/req/req_set.py", line 646, in install
**kwargs
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/req/req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/req/req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/wheel.py", line 465, in move_wheel_files
generated.extend(maker.make(spec))
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 353, in make
self._make_script(entry, filenames, options=options)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 257, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 231, in _write_script
self._fileop.write_binary_file(outname, script_bytes)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/_vendor/distlib/util.py", line 388, in write_binary_file
with open(path, 'wb') as f:
IOError: [Errno 13] Permission denied: '/bin/easy_install'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==13.2.0.dev0', 'console_scripts', 'virtualenv')()
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 699, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 872, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 837, in install_wheel
'PIP_USER': '0'
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 777, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/myusername/c...da/env/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 2
About halfway down that output you can see virtualenv looking for /bin/easy_install
$ ls -al /bin/easy_install
ls: /bin/easy_install: No such file or directory
$ ls -al /usr/local/bin/easy_install
lrwxr-xr-x 1 myusername admin 40 Dec 22 14:21 /usr/local/bin/easy_install -> ../Cellar/python/2.7.11/bin/easy_install
But it should be looking in /usr/local/bin instead because that's the only easy_install I have now and it works:
$ which easy_install
/usr/local/bin/easy_install
$ easy_install
install_dir /usr/local/lib/python2.7/site-packages/
error: No urls, filenames, or requirements specified (see --help)
I've tried to pip uninstall virtualenv then pip install virtualenv but that didn't help - same issue.
Anyone know how to fix this?
Thanks!
====================
EDIT: Solved!
Tried using /usr/local/bin/virtualenv-2.7 and it worked as expected. I moved /usr/local/bin/virtualenv then symlinked /usr/local/bin/virtualenv-2.7 back to /usr/local/bin/virtualenv --- now all appears to be well in the world.
Solved! Tried using /usr/local/bin/virtualenv-2.7 and it worked as expected. I moved /usr/local/bin/virtualenv then symlinked /usr/local/bin/virtualenv-2.7 back to /usr/local/bin/virtualenv --- now all appears to be well in the world.
I compiled my own Python 3, then installed virtualenvwrapper. But after I switched from compiling my own Python to using the deadsnakes PPA I ran into the issue described in the question above.
Seems there's something going on with the #! part of the virtualenv script.
The error I was getting was as follows:
nb#ubuntu-0xA520322HC30H:~/proj/redis-py$ mkvirtualenv --python='/usr/bin/python3' redispytest
bash: /home/nb/.local/bin/virtualenv: /usr/local/bin/python3.6: bad interpreter: No such file or directory
My system Python setup had the following symlinks and Python locations:
nb#ubuntu-0xA520322HC30H:~/proj/redis-py$ ls -la /usr/bin/python3
lrwxrwxrwx 1 root root 9 Feb 8 11:43 /usr/bin/python3 -> python3.5
nb#ubuntu-0xA520322HC30H:~/proj/redis-py$ ls -la /usr/bin/python3.5
-rwxr-xr-x 2 root root 4464400 Nov 28 08:53 /usr/bin/python3.5
nb#ubuntu-0xA520322HC30H:~/proj/redis-py$ which python3.5
/usr/bin/python3.5
nb#ubuntu-0xA520322HC30H:~/proj/redis-py$ ls -la /usr/bin/python3.5
-rwxr-xr-x 2 root root 4464400 Nov 28 08:53 /usr/bin/python3.5
nb#ubuntu-0xA520322HC30H:~/proj/redis-py$ ls -la /usr/bin/python3.6
-rwxr-xr-x 2 root root 4695328 Jan 28 10:49 /usr/bin/python3.6
nb#ubuntu-0xA520322HC30H:~/proj/redis-py$ which virtualenv
/home/nb/.local/bin//virtualenv
And, in /home/nb/.local/bin/¹:
nb#ubuntu-0xA520322HC30H:~/proj/redis-py$ cd ~/.local/bin
nb#ubuntu-0xA520322HC30H:~/.local/bin$ ls
pbr pip2 pip3 virtualenv virtualenvwrapper_lazy.sh
pip pip2.7 pip3.5 virtualenv-clone virtualenvwrapper.sh
I wondered where this mysterious, and completely absent /usr/local/bin/python3.6 was in the code.
So I installed a full-text search tool and looked for it in the ~/.local folder.
nb#ubuntu-0xA520322HC30H:~$ cd .local
nb#ubuntu-0xA520322HC30H:~/.local$ sudo apt-get install --quiet --quiet silversearcher-ag
nb#ubuntu-0xA520322HC30H:~/.local$ ag '/usr/local/bin/python3.6'
bin/virtualenv-clone
1:#!/usr/local/bin/python3.6
bin/pbr
1:#!/usr/local/bin/python3.6
Looks like the static reference to Python's in 2 places.
I now have two options:
I can edit the /usr/local/bin/python3.6 text in there to refer to /usr/bin/python3.6
I can make a symlink from /usr/local/bin/python3.6 -> /usr/bin/python3.6
I went with option 1 for the bin/virtualenv-clone file:
But I also did option 2, just in case this problem exists elsewhere on my system.
nb#ubuntu-0xA520322HC30H:~$ sudo ln -s /usr/bin/python3.6 /usr/local/bin/python3.6
Well, whatever it was, that worked:
nb#ubuntu-0xA520322HC30H:~/.local$ mkvirtualenv --python='/usr/bin/python3' redispytest
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/nb/Envs/redispytest/bin/python3
Also creating executable in /home/nb/Envs/redispytest/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /home/nb/Envs/redispytest/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/nb/Envs/redispytest/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/nb/Envs/redispytest/bin/preactivate
virtualenvwrapper.user_scripts creating /home/nb/Envs/redispytest/bin/postactivate
virtualenvwrapper.user_scripts creating /home/nb/Envs/redispytest/bin/get_env_details
(redispytest) nb#ubuntu-0xA520322HC30H:~/.local$
Summary: Find out which interpreter location your virtualenv is trying to use, and make a symlink from that location to your actual Python.
The reason you need to do this is that at least a few virtualenv locations will have a #! line that refers to a specific location, but won't change if you, say, switch from compiling your own Python to using a PPA.
At first I was hesitant to do this, since I prefer to let the package manager handle this sort of thing, and not complicate my paths too much. But there really doesn't seem to be any other way to fix this. I tried uninstalling and reinstalling both virtualenv and virtualenvwrapper, to no avail.
¹Hmmm... there's pbr's in my .local/bin. What's next, my .local/fridge? Damn hipsters.

Installation issues for Virtualenv and VirtualenvWrapper in Ubuntu 13.04

Ubuntu Server in VirtualBox. I am trying to install VirtualEnv to start learning Flask and bottle.
Some details of my setup.
vks#UbSrVb:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="12.04.2 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.2 LTS)"
VERSION_ID="12.04"
vks#UbSrVb:~$ python --version
Python 2.7.3
vks#UbSrVb:~$ echo $VIRTUALENVWRAPPER_PYTHON
/usr/bin/python
vks#UbSrVb:~$ echo $VIRTUALENV_PYTHON
vks#UbSrVb:~$
When I boot my Virtual Machine, I get the following error on my console
/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenv has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.
When i try to initialize a virtualenv I get the following errors
vks#UbSrVb:~/dropbox/venv$ virtualenv try1
New python executable in try1/bin/python3.2
Also creating executable in try1/bin/python
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==1.9.1', 'console_scripts', 'virtualenv')()
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 979, in main
no_pip=options.no_pip)
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 1081, in create_environment
site_packages=site_packages, clear=clear))
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 1499, in install_python
os.symlink(py_executable_base, full_pth)
OSError: [Errno 30] Read-only file system
vks#UbSrVb:~/dropbox/venv$ ls
try1
vks#UbSrVb:~/dropbox/venv$ ls try1/
bin include lib
vks#UbSrVb:~/dropbox/venv$
My .bashrc entries
export WORKON_HOME='~/dropbox/venv/'
source '/usr/local/bin/virtualenvwrapper.sh'
Q1 - As per the error at bootup, How do I ensure virtualenv is installed for VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly ?
Q2 - Even with sudo I get the same "Read-only file system" Error ?
I have tried installing virtualenv using pip and then apt-get, just to hit and try.
Try setting your WORKON_HOME global to another path (~/.virtualenvs) for example a see if that works, maybe the problem is with that shared directory, are you using windows? If you are, try installing ntfs-3g, see https://askubuntu.com/questions/70281/why-does-my-ntfs-partition-mount-as-read-only
Also in my profile configuration file I like to detect first if virtualenvwrapper is installed:
if which virtualenvwrapper.sh &> /dev/null; then
WORKON_HOME=$HOME/.virtualenvs
# path to virtualenvwrapper, in my case
source /usr/local/share/python/virtualenvwrapper.sh
fi
I had the problem where my pip was for a different version of python than the one I wanted to use.
$ python -V
Python 2.7.5+
$ pip -V
pip 1.5.4 from /usr/local/lib/python3.3/dist-packages (python 3.3)
So when I used pip to install virtualenv and virtualenvwrapper, the new python packages were put in python3.3's dist-packages, so of course my python2.7 couldn't find them!
To fix this, I had to use the appropriate version of pip, in my case it was pip2.
$ pip2 -V
pip 1.5.4 from /usr/local/lib/python2.7/dist-packages (python 2.7)
So make sure you are using the appropriate version of pip.

Why am I getting this error (related to pip and easy_install) when trying to setup a virtualenv?

I'm trying to create a Flask application to push to Heroku. When I try to create a virtualenv in the folder, I'm thrown this error:
photo-crawl › sudo virtualenv venv --distribute
Password:
New python executable in venv/bin/python
Installing distribute............................................................................................................................................................................................................................done.
Installing pip....
Complete output from command /Users/evansiegel/In...rawl/venv/bin/python -x /Users/evansiegel/In...env/bin/easy_install /Library/Python/2.7/...ort/pip-1.2.1.tar.gz:
/Users/evansiegel/Involvio/photo-crawl/venv/bin/python: can't open file '/Users/evansiegel/Involvio/photo-crawl/venv/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==1.8.4', 'console_scripts', 'virtualenv')()
File "/Library/Python/2.7/site-packages/virtualenv.py", line 964, in main
never_download=options.never_download)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 1076, in create_environment
install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 667, in install_pip
filter_stdout=_filter_setup)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 1042, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/evansiegel/In...rawl/venv/bin/python -x /Users/evansiegel/In...env/bin/easy_install /Library/Python/2.7/...ort/pip-1.2.1.tar.gz failed with error code 2
It seems that for some reason virtualenv is not putting everything it should be putting into the venv/bin folder. Right now, only python and two aliases, python2 and python2.7 are in there.
Thanks!
I believe this is caused by a bug in older versions of virtualenv and/or pip. It looks like you're using virtualenv 1.8.4 and pip 1.2.1. Is it possible for you to upgrade to latest virtualenv and pip (currently virtualenv 1.9.1 and pip 1.3.1)?
This should do it, if you have install privileges:
pip install pip --upgrade
pip install virtualenv --upgrade
At that point running the same command (i.e. sudo virtualenv venv --distribute) should give you what you want.

Python Virtualenv: creating python2.5 environment on ubuntu 10.04

when I try to create a virtualenv that uses python2.5 I get the following error:
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 1489, in <module>main()
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 526, in main use_distribute=options.use_distribute)
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 609, in create_environment
site_packages=site_packages, clear=clear))
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 672, in install_python fix_lib64(lib_dir)
File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 891, in fix_lib64
if [p for p in distutils.sysconfig.get_config_vars().values()
File "/usr/lib/python2.5/distutils/sysconfig.py", line 499, in get_config_vars func()
File "/usr/lib/python2.5/distutils/sysconfig.py", line 351, in _init_posix filename = get_makefile_filename()
File "/usr/lib/python2.5/distutils/sysconfig.py", line 210, in get_makefile_filename
return os.path.join(lib_dir, "config" + (sys.pydebug and "_d" or ""), "Makefile")
AttributeError: 'module' object has no attribute 'pydebug'
I get this error by doing this command:
virtualenv -p python2.5 .
Because Ubuntu10.04 doesn't come with Python2.5 I installed it from:
https://launchpad.net/~fkrull/+archive/deadsnakes
First I thought that I should installed virtualenv for Python2.5 also but that doesn't seem to work either. If I try to create a virtualenv with the following command:
sudo Python2.5 /usr/lib/python2.5/site-packages/virtualenv.py .
I end up getting the same error. I am kinda new to Ubuntu and Python and there are stil a few blank spot. Like if you have two version of Python, for Python2.6 I can just do virtualenv . But I guess to use the 2.5 one I have to call it directly like I did in the sudo command above?
Or is it completely wrong and all virtualenvs are the same and can be used with different Python versions?
Anyway my main question is how I can fix the error so I can setup a virtualenv using Python2.5. Any extra information is appreciated.
I had some other Python 2.5 installed. I forgot the name but something like Python 2.5 minimal and it gave some problems with the deadsnakes install. When I uninstall it everything started working fine.
You don't need two virtualenvs installed. You can tell virtualenv which python to use by using the --python argument as follows:
virtualenv --python=python2.5 <my-venv>
I was able to get this going in Ubuntu 10.04 Lucid Lynx (which comes with Python 2.6 installed by default) like so:
Install Python 2.5 using the repository at https://launchpad.net/~fkrull/+archive/deadsnakes.
If you don't know how to do this:
1a. Edit /etc/apt/sources.list by adding the line: deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu lucid main
1b. Run 'sudo apt-get update'.
1c. Run 'sudo apt-get install python2.5'.
1d. Verify that python2.5 is on the PATH by running 'which python2.5'.
Run 'virtualenv -p python2.5 ENV' (where ENV is whatever you want to call your environment directory).
You can then do the usual stuff like '. env/bin/activate' and so on. This method worked just fine for me, but let me know if run into problems with your setup.
sudo easy_install-2.5 virtualenv
will give you a python 2.5-specific virtualenv. Invoke it using virtualenv-2.5. You may need to apt-get install setuptools first if you don't have easy_install.

Categories