Virtualenv returns the error "There is no such file or directory ..."

The virtualenv --no-site-packages env/ command virtualenv --no-site-packages env/ creates the following error stack trace:

  The --no-site-packages flag is deprecated; it is now the default behavior. New python executable in env/bin/python Installing setuptools.............done. Installing pip... Error [Errno 2] No such file or directory while executing command /home/zach/School/CS...env/bin/easy_install /usr/local/lib/pytho...pport/pip-1.1.tar.gz ...Installing pip...done. Traceback (most recent call last): File "/usr/local/bin/virtualenv", line 9, in <module> load_entry_point('virtualenv==1.7.1.2', 'console_scripts', 'virtualenv')() File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 928, in main never_download=options.never_download) File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 1042, in create_environment install_pip(py_executable, search_dirs=search_dirs, never_download=never_download) File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 640, in install_pip filter_stdout=_filter_setup) File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 966, in call_subprocess cwd=cwd, env=env) File "/usr/lib/python2.7/subprocess.py", line 679, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1239, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory 

I am using Ubuntu 11.10 and Python 2.7.

EDIT: It turned out.

I originally installed it using pip, so I uninstalled it through pip and reinstalled via apt-get .

+6
source share
4 answers

virtualenv is trying to try installing pip using easy_install from the local archive. Can you verify that it exists in /usr/local/lib/pytho...pport/pip-1.1.tar.gz ?

You might want to make sure that you have the protocol installed correctly. First try easy_install -U pip .

+6
source

I had the same thing on debian. Updating python-virtualenv fixes the problem.

 apt-get upgrade python-virtualenv 
+3
source

In mac run pip install virtualenv virtualenvwrapper to install virtualenv.

+1
source

You must make sure that the path to easy_install does not contain spaces: / home / zach / School / CS ... env / bin / easy_install

0
source

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


All Articles