$ virtualenv --no-site-packages myenv
The --no-site-packages flag is deprecated; it is now the default behavior.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
load_entry_point('virtualenv==1.7.1.2', 'console_scripts', 'virtualenv')()
File "/usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 928, in main
never_download=options.never_download)
File "/usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 1029, in create_environment
site_packages=site_packages, clear=clear))
File "/usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 1154, in install_python
mkdir(lib_dir)
File "/usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 399, in mkdir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: 'myenv'
I have been struggling to figure out how to be able to get virtualenv to make a new environment without sudo.
1 Answer 1
It looks like you're trying to create your environment in a location that you don't have permission to. Where are you attempting to create the environment? If you're doing this in a shared hosting environment, you want to create your virtualenv in your home directory.
Alternatively, use virtualenvwrapper, and that should take care of most of the decisions you need to make (like where to store your envs).
Comments
Explore related questions
See similar questions with these tags.
myenvfrom the directory you are currently in? Is it possible there is already a file there, or are you running someplace other than your account home directory?