virtualenv problem

D

D. Xenakis

Hi there.
Im using windows 7 64bit
I have installed python 3.3.2 in C:\Python33
and then easy_install , pip, and virtualenv.
But i do not know if the virtualenv installation is correct as i cant seem to be able to create any virtual enviroment yet.

How can i check if everything is correct? What exactly should i do to create a virtual enviroment into my new_project folder located here: in C:\new_project ?
I think there is something wrong with the installation because when i run through idle the virtual-env scripts located in "C:\Python33\Scripts" then i get the following..

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.You must provide a DEST_DIR
Usage: virtualenv-3.3-script.py [OPTIONS] DEST_DIR

Options:
--version show program's version number and exit
-h, --help show this help message and exit
-v, --verbose Increase verbosity
-q, --quiet Decrease verbosity
-p PYTHON_EXE, --python=PYTHON_EXE
The Python interpreter to use, e.g.,
--python=python2.5 will use the python2.5 interpreter
to create the new environment. The default is the
interpreter that virtualenv was installed with
(C:\Python33\pythonw.exe)
--clear Clear out the non-root install and start from scratch
--no-site-packages Don't give access to the global site-packages dir to
the virtual environment (default)
--system-site-packages
Give access to the global site-packages dir to the
virtual environment
--always-copy Always copy files rather than symlinking
--unzip-setuptools Unzip Setuptools when installing it
--relocatable Make an EXISTING virtualenv environment relocatable.
This fixes up scripts and makes all .pth files
relative
--no-setuptools Do not install setuptools (or pip) in the new
virtualenv.
--no-pip Do not install pip in the new virtualenv.
--extra-search-dir=SEARCH_DIRS
Directory to look for setuptools/pip distributions in.
You can add any number of additional --extra-search-
dir paths.
--never-download Never download anything from the network. This is now
always the case. The option is only retained for
backward compatibility, and does nothing. Virtualenv
will fail if local distributions of setuptools/pip are
not present.
--prompt=PROMPT Provides an alternative prompt prefix for this
environment
--setuptools Backward compatibility. Does nothing.
--distribute Backward compatibility. Does nothing.
Traceback (most recent call last):
File "C:\Python33\Scripts\virtualenv-3.3-script.py", line 9, in <module>
load_entry_point('virtualenv==1.10', 'console_scripts', 'virtualenv-3.3')()
File "C:\Python33\lib\site-packages\virtualenv.py", line 786, in main
sys.exit(2)
SystemExit: 2


plz any help appreciated
 
A

alex23

I think there is something wrong with the installation because when i run through idle the virtual-env scripts located in "C:\Python33\Scripts" then i get the following..

virtualenv is intended to be a command line tool, so running it through
idle is your first problem :)
You must provide a DEST_DIR
Usage: virtualenv-3.3-script.py [OPTIONS] DEST_DIR

The error you're receiving seems pretty explicit.

Generally, you would go to, say, a projects folder and type at the
command line:

C:\Projects> virtualenv my-new-project
C:\Projects> cd my-new-project
C:\Projects\my-new-project> Scripts\activate.bat

This will create & enable your virtualenv sandbox.

For more info see:

http://www.virtualenv.org/en/latest/#usage
 
D

D. Xenakis

Yeah trying to run virtualenv under IDLE was a desperate move as i couldnt make anything work under cmd.

Apparently my problem was that i did not have correctly setup the new path...

Solution for me was the following from "http://forums.udacity.com/questions/100064678/pip-installation-instructions"

----------------------------------------------
...We want to add that directory to your Path environment variable. Path is a list of directories where your OS looks for executable files. You will need to change the directory if you installed Python in a non-default location.

a. go to Control Panel » System » Advanced » Environment Variables, make sure Path is selected under "user variables for
user", and click edit.

b. Add ;C:\Python33\Scripts\ and ;C:\Python33\ (no spaces after the previous entry, ';' is the delimiter) to the end of variable value, then click ok.You should not be erasing anything, just adding to what's already there.

This just makes it so we don't have to type the full path name whenever we want to run pip or other programs in those directories.
"C:\Python33\Scripts\" is the one we want now, but "C:\Python33\" might be useful for you in the future.

Restart your computer.
 
A

alex23

Apparently my problem was that i did not have correctly setup the new path..
But hey - learning is a good thing

+1!

Also, good job on posting the solution you found as well, that's always
helpful if anyone else hits the same problem.

Personally, I tend to use the ActiveState Python installer; it not only
takes care of a lot of the general Windows integration, it also includes
a handful of Windows-oriented libraries. It's not a big enough
difference to worry about if you've managed to get things working now,
but for subsequent Python versions it might be convenient.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top