What could be wrong here?
user#linux> virtualenv foobar
....
error: could not create '/lib/python2.7': Permission denied
----------------------------------------
...Installing Setuptools...done.
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==1.10.1', 'console_scripts', 'virtualenv')()
File "/usr/lib/python2.7/site-packages/virtualenv.py", line 821, in main
symlink=options.symlink)
File "/usr/lib/python2.7/site-packages/virtualenv.py", line 961, in create_environment
install_sdist('Setuptools', 'setuptools-*.tar.gz', py_executable, search_dirs)
File "/usr/lib/python2.7/site-packages/virtualenv.py", line 932, in install_sdist
filter_stdout=filter_install_output)
File "/usr/lib/python2.7/site-packages/virtualenv.py", line 899, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/modwork_guf_dfj/foobar/bin/python setup.py install --single-version-externally-managed --record record failed with error code 1
virtualenv --version
1.10.1
Answering my own question.
in ~/.pydistutils.cfg an empty prefix was set. After commenting this prefix, creating the virtualenv worked.
#http://stackoverflow.com/questions/4495120/combine-user-with-prefix-error-with-setup-py-install
#[install]
#prefix=
Related
I have an Error while creating virtual environmenr on Python 3.73 in Windows 7.
During creation of new virtual environment I am getting error like below.
Can somebody help me with this. I have already searched tonns of info and nothing helps me out.
Thanks in advance
Using base prefix 'C:\\Users\\Саша\\AppData\\Local\\Programs\\Python\\Python37-32'
New python executable in C:\Users\Саша\myenv\Scripts\python.exe
Command C:\Users\Саша\myenv\Scripts\python.exe -m pip config list had error code 1
Installing setuptools, pip, wheel...
Complete output from command C:\Users\Саша\myenv\Scripts\python.exe - setuptools pip wheel:
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
ModuleNotFoundError: No module named 'pkgutil'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "C:\Users\Саша\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 193, in _run_module_as
"__main__", mod_spec)
File "C:\Users\Саша\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 2635, in <module>
main()
File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 870, in main
symlink=options.symlink,
File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 1173, in create_e
install_wheel(to_install, py_executable, search_dirs, download=download)
File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 1019, in install_
_install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)
File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 1110, in _install
arch_dir
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=script)
File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 963, in call_subp
raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode))
OSError: Command C:\Users\Саша\myenv\Scripts\python.exe - setuptools pip wheel failed with error code 1
Try it with removing python to 'c:\python37' from appdata. It cuz you have unicode chars in the path name.
I am attempting to use virtualenvwrapper to create a virtual environment using a specific local python interpreter:
mkvirtualenv -p /home/nelse003/software/ccp4-linux64-2016-10-22-0115/libexec/python2.7 ccp4-python-env`
But it fails to create the virtual environment:
Running virtualenv with interpreter /home/nelse003/software/ccp4-linux64-2016-10-22-0115/libexec/python2.7
New python executable in /home/nelse003/.virtualenvs/ccp4-python-env/bin/python2.7
Not overwriting existing python script /home/nelse003/.virtualenvs/ccp4-python-env/bin/python (you must use /home/nelse003/.virtualenvs/ccp4-python-env/bin/python2.7)`
Installing setuptools, pip, wheel...`
Complete output from command /home/nelse003/.virt...on-env/bin/python2.7 - setuptools pip wheel:`
Traceback (most recent call last):
File "<stdin>", line 7, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 28, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/vcs/mercurial.py", line 9, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 36, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/utils/glibc.py", line 4, in <module>
File "/home/nelse003/software/ccp4-linux64-2016-10-22-0115/lib/python2.7/ctypes/__init__.py", line 10, in <module>
from _ctypes import Union, Structure, Array
ImportError: /home/nelse003/.virtualenvs/ccp4-python-env/lib/python2.7/lib-dynload/_ctypes.so: undefined symbol: PyUnicodeUCS2_FromUnicode`
----------------------------------------
...Installing setuptools, pip, wheel...done.
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 945, in create_environment
download=download,
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 901, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 797, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/nelse003/.virt...on-env/bin/python2.7 - setuptools pip wheel failed with error code 1
Is this error related to the version of python I an trying to use for the virtual environment?
It worked a few days ago but creating a new vertualenv today causes this failure.
Tried installation of python-setuptools separately, also failed with same issue. It is on Mac OS.
mac:django bgbb$ virtualenv vnv
New python executable in vnv/bin/python
Installing setuptools, pip...
Complete output from command /Users/bgbb/Developer/django/vnv/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip:
Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking setuptools
Cleaning up...
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-1.5.5-py2.py3-none-any.whl/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-1.5.5-py2.py3-none-any.whl/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-1.5.5-py2.py3-none-any.whl/pip/req.py", line 1197, in prepare_files
do_download,
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-1.5.5-py2.py3-none-any.whl/pip/req.py", line 1364, in unpack_url
unpack_file_url(link, location, download_dir)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-1.5.5-py2.py3-none-any.whl/pip/download.py", line 640, in unpack_file_url
unpack_file(from_path, location, content_type, link)
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-1.5.5-py2.py3-none-any.whl/pip/util.py", line 621, in unpack_file
unzip_file(filename, location, flatten=not filename.endswith(('.pybundle', '.whl')))
File "/Library/Python/2.7/site-packages/virtualenv_support/pip-1.5.5-py2.py3-none-any.whl/pip/util.py", line 491, in unzip_file
zip = zipfile.ZipFile(zipfp)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 766, in __init__
self._RealGetContents()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 807, in _RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file
Storing debug log for failure in /Users/bgbb/.pip/pip.log
----------------------------------------
...Installing setuptools, pip...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
load_entry_point('virtualenv==1.11.5', 'console_scripts', 'virtualenv')()
File "/Library/Python/2.7/site-packages/virtualenv.py", line 824, in main
symlink=options.symlink)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 992, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 960, in install_wheel
'PIP_NO_INDEX': '1'
File "/Library/Python/2.7/site-packages/virtualenv.py", line 902, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/bgbb/Developer/django/vnv/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 2
lots of posts about this issue, downgrading to virtualenv 1.10.1 seems to be a fix.
github venev issue
When I was trying to create a virtual django env. with "virtualenv --no-site-packages django", I was getting error as follows,
New python executable in django/bin/python
Installing setuptools, pip...
Complete output from command /home/krishna/KRISHN...on/django/bin/python -c "import sys, pip; pip...ll\"] + sys.argv[1:])" setuptools pip:
Traceback** (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv-1.11-py2.7.egg/virtualenv_support/pip-1.5-py2.py3-none-any.whl/pip/__init__.py", line 9, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv-1.11-py2.7.egg/virtualenv_support/pip-1.5-py2.py3-none-any.whl/pip/log.py", line 8, in <module>
ImportError: No module named pkg_resources
----------------------------------------
...Installing setuptools, pip...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==1.11', 'console_scripts', 'virtualenv')()
File "/usr/local/lib/python2.7/dist-packages/virtualenv-1.11-py2.7.egg/virtualenv.py", line 820, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/dist-packages/virtualenv-1.11-py2.7.egg/virtualenv.py", line 988, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/usr/local/lib/python2.7/dist-packages/virtualenv-1.11-py2.7.egg/virtualenv.py", line 956, in install_wheel
'PIP_NO_INDEX': '1'
File "/usr/local/lib/python2.7/dist-packages/virtualenv-1.11-py2.7.egg/virtualenv.py", line 898, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/krishna/KRISHN...on/django/bin/python -c "import sys, pip; pip...ll\"] + sys.argv[1:])" setuptools pip failed with error code 1***
$ sudo virtualenv test
Password:
Sorry, try again.
Password:
New python executable in test/bin/python
Installing setuptools.............done.
Installing pip....
Complete output from command /Users/hhimanshu/test/bin/python -x /Users/hhimanshu/test/bin/easy_install /Library/Python/2.7/...ort/pip-1.2.1.tar.gz:
/Users/hhimanshu/test/bin/python: can't open file '/Users/hhimanshu/test/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
load_entry_point('virtualenv==1.8.2', 'console_scripts', 'virtualenv')()
File "/Library/Python/2.7/site-packages/virtualenv.py", line 942, in main
never_download=options.never_download)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 1054, 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 655, in install_pip
filter_stdout=_filter_setup)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 1020, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/hhimanshu/test/bin/python -x /Users/hhimanshu/test/bin/easy_install /Library/Python/2.7/...ort/pip-1.2.1.tar.gz failed with error code 2
How did you install virtualenv? This works for me using explicit paths:
sudo /usr/bin/easy_install-2.7 virtualenv
/usr/local/bin/virtualenv-2.7 test