creating virtualenv error message
The pyramid documentation says:
- "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"
- to install a Virtual Python Enviroment, I have to install setuptools, it worked
- to create a Virtual Python Enviroment, I have to run "virtualenv --no-site-packages env"
- 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
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
As somebody already said, you need to start the virtualenv
without sudo
.
This is what worked for me.
after installing setuptools and running "virtualenv --no-site-package" you didnt actually install virtualenv
so first you must install virtualenv (you must be root for this):
$ easy_install virtualenv
then just do:
$ virtualenv --no-site-package myVirtualEnv
New python executable in myVirtualEnv/bin/python
Installing setuptools............done.
also linux is a unix like system (to answer your question if "Linux is a kind of Unix"). here you will find out more about unix-like systems - wikipedia-Unix-like
精彩评论