Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > virtualenv problem

Reply
Thread Tools

virtualenv problem

 
 
D. Xenakis
Guest
Posts: n/a
 
      07-25-2013
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.
>>> ================================ RESTART ================================
>>>

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
 
Reply With Quote
 
 
 
 
alex23
Guest
Posts: n/a
 
      07-26-2013
On 25/07/2013 11:48 PM, D. Xenakis wrote:
> 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
 
Reply With Quote
 
 
 
 
D. Xenakis
Guest
Posts: n/a
 
      07-26-2013
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.
----------------------------------------------

I realised that even if i didn't do the above, i could still have got things rolling just by cd-ing from the cmd, to the script folder of my Python installation.

But hey - learning is a good thing
 
Reply With Quote
 
alex23
Guest
Posts: n/a
 
      07-30-2013
On 26/07/2013 10:25 PM, D. Xenakis wrote:
> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inexplicable Urllib2 problem between virtualenv's when POSTing to aTomcat server Timmy O'Mahony Python 2 09-25-2011 04:48 PM
ipython installed in virtualenv seems not to use virtualenv Gelonida N Python 4 08-11-2011 11:06 AM
virtualenv problem on win32 Danny Shevitz Python 1 06-07-2011 10:46 PM
Problem installing psycopg2 in virtualenv (Ubuntu 10.04, Python 2.5) Pascal Polleunus Python 5 10-05-2010 01:48 PM
virtualpython / workingenv / virtualenv ... shouldn't this be part of python Damjan Python 5 01-15-2008 08:57 AM



Advertisments