Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

creating virtualenv error message

Tags:

python

pyramid

The pyramid documentation says:

  1. "It is best practice to install Pyramid into a 'virtual' Python environment in order to obtain isolation from any 'system' packages you’ve got installed in your Python version"
  2. to install a Virtual Python Enviroment, I have to install setuptools, it worked
  3. to create a Virtual Python Enviroment, I have to run "virtualenv --no-site-packages env"
  4. after saying the command, it says "If you’re on UNIX, do not use sudo to run the virtualenv script"

On 3, I ran the command, got permission denied and used sudo. I don't know if the using sudo part is going to be a problem, because I'm not sure if Linux is a kind of Unix.

Now, how to create a virtual python enviroment after seeing this message?

Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.5.1', 'console_scripts', 'virtualenv')()
  File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.5.1-py2.6.egg/virtualenv.py", line 558, in main
    prompt=options.prompt)
  File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.5.1-py2.6.egg/virtualenv.py", line 647, in create_environment
    site_packages=site_packages, clear=clear))
  File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.5.1-py2.6.egg/virtualenv.py", line 931, in install_python
    stdout=subprocess.PIPE)
  File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied
like image 544
Delirium tremens Avatar asked Nov 26 '22 17:11

Delirium tremens


1 Answers

Make sure you are in a directory that you can create files and folders in, e.g.:

cd # Go to your home directory
virtualenv --no-site-packages env # Create virtualenv
like image 64
Ric Avatar answered Jan 03 '23 00:01

Ric