4

I have installed Python 2.7 on my ubuntu 10 LTS

tar xzf Python-2.7.tgz
cd Python-2.7
./configure
make
sudo make altinstall

The python seems to be correctly installed.

I have installed virtualenv.

Everything works fine if I create an envrionment using:

sudo virtualenv env 

But if I try to use:

sudo virtualenv env --p python2.7 --no-site-packages

I have the follwing error:

ImportError: No module named warnings
ERROR: The executable env1/bin/python2.7 is not functioning
ERROR: It thinks sys.prefix is '/home/me/Documents/test1' (should be '/home/me/Documents/test1/env')
ERROR: virtualenv is not compatible with this system or executable

On another machine, everything works fine with Python2.7 so I guess there something wrong with my python2.7 install or with my virtualenv install, but I have no idea how to start looking where the problem is hidden

2 Answers 2

1

I installed a brand new system ubuntu10.04 LTS I installed python

sudo add-apt-repository ppa:fkrull/deadsnakes sudo apt-get update sudo apt-get install python2.7

I install virtualenv sudo apt-get install python-virtualenv

The command sudo virtualenv env -p python2.7

Fails and returns :

ImportError: No module named warnings ERROR: The executable env/bin/python2.7 is not functioning ERROR: It thinks sys.prefix is '/home/me/Documents/code/jord' (should be '/home/me/Documents/code/jord/env')

UPDATE

I edited the source of virtualenv.py and added 'warnings' and '_weakrefset' in the list of REQUIRED_MODULES and it seems to work now

Sign up to request clarification or add additional context in comments.

Comments

0

Any reason why you want to compile python yourself? It is ubuntu so I would install setuptools, virtualenv and virtualenvwrapper using apt-get. Then follow http://www.doughellmann.com/docs/virtualenvwrapper/ to setup virtualenvwrapper properly. Python 2.7 will automatically be included for you in any VE you build.

2 Comments

Reading some forums, it seemed that compiling python2.7 was the best way to install it on ubuntu LTS
I have install python2.7 using DeadSnakes PPA, I still run into the same prob

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.