Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51221 > unrolled thread

virtualenv problem

Started by"D. Xenakis" <gouzounakis@hotmail.com>
First post2013-07-25 06:48 -0700
Last post2013-07-30 10:25 +1000
Articles 4 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  virtualenv problem "D. Xenakis" <gouzounakis@hotmail.com> - 2013-07-25 06:48 -0700
    Re: virtualenv problem alex23 <wuwei23@gmail.com> - 2013-07-26 10:47 +1000
      Re: virtualenv problem "D. Xenakis" <gouzounakis@hotmail.com> - 2013-07-26 05:25 -0700
        Re: virtualenv problem alex23 <wuwei23@gmail.com> - 2013-07-30 10:25 +1000

#51221 — virtualenv problem

From"D. Xenakis" <gouzounakis@hotmail.com>
Date2013-07-25 06:48 -0700
Subjectvirtualenv problem
Message-ID<626bd852-a79e-42d7-aaa9-c5cba477d155@googlegroups.com>
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

[toc] | [next] | [standalone]


#51269

Fromalex23 <wuwei23@gmail.com>
Date2013-07-26 10:47 +1000
Message-ID<kssgij$ul0$1@dont-email.me>
In reply to#51221
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

[toc] | [prev] | [next] | [standalone]


#51298

From"D. Xenakis" <gouzounakis@hotmail.com>
Date2013-07-26 05:25 -0700
Message-ID<4fdf3e7c-0c1f-4048-b4bb-006e8cd42f30@googlegroups.com>
In reply to#51269
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

[toc] | [prev] | [next] | [standalone]


#51531

Fromalex23 <wuwei23@gmail.com>
Date2013-07-30 10:25 +1000
Message-ID<kt70qh$n06$1@dont-email.me>
In reply to#51298
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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web