virtualenv problem

Discussion in 'Python' started by D. Xenakis, Jul 25, 2013.

  1. D. Xenakis

    D. Xenakis Guest

    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
     
    D. Xenakis, Jul 25, 2013
    #1
    1. Advertising

  2. D. Xenakis

    alex23 Guest

    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
     
    alex23, Jul 26, 2013
    #2
    1. Advertising

  3. D. Xenakis

    D. Xenakis Guest

    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
     
    D. Xenakis, Jul 26, 2013
    #3
  4. D. Xenakis

    alex23 Guest

    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.
     
    alex23, Jul 30, 2013
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pascal Polleunus
    Replies:
    5
    Views:
    1,347
    Pascal Polleunus
    Oct 5, 2010
  2. Danny Shevitz

    virtualenv problem on win32

    Danny Shevitz, Apr 13, 2011, in forum: Python
    Replies:
    1
    Views:
    435
  3. Gelonida N
    Replies:
    4
    Views:
    982
    Gelonida N
    Aug 11, 2011
  4. Timmy O'Mahony
    Replies:
    2
    Views:
    275
    Timmy O'Mahony
    Sep 25, 2011
  5. D. Xenakis

    PyQt5 and virtualenv problem

    D. Xenakis, Jul 28, 2013, in forum: Python
    Replies:
    4
    Views:
    291
    Pete Forman
    Aug 2, 2013
Loading...

Share This Page