VirtualEnv python2.7 error

I installed Python 2.7 on my ubuntu 10 LTS

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

It seems that python is installed correctly.

I 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 following 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 think something is wrong with my python2.7 installation or my virtualenv installation, but I have no idea how to start looking for where the problem is hidden.

+4
source share
2 answers

I installed the new ubuntu10.04 LTS system I installed python

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

I install virtualenv sudo apt-get install python-virtualenv

Sudo virtualenv env -p python2.7 command

Failure and Refund:

ImportError: no modules with warnings ERROR: executable file env / bin / python2.7 does not work ERROR: It thinks sys.prefix is' / home / me / Documents / code / jord '(should be' / home / me / Documents / code / jord / env ')

UPDATE

I edited the virtualenv.py source and added the “warnings” and “_weakrefset” to the REQUIRED_MODULES list and it seems to work now

+1
source

Any reason you want to compile python yourself? This is ubuntu, so I would install setuptools, virtualenv and virtualenvwrapper using apt-get. Then do http://www.doughellmann.com/docs/virtualenvwrapper/ to configure virtualenvwrapper correctly. Python 2.7 will automatically be enabled for you in any VE that you create.

0
source

Source: https://habr.com/ru/post/1396389/


All Articles