Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Problems running VirtualEnv under Windows.

Reply
Thread Tools

Problems running VirtualEnv under Windows.

 
 
ashconnor
Guest
Posts: n/a
 
      07-12-2010
Hello,

After reading 'Practical Django Projects' I decided that I want to
implement the VirtualEnv tip suggested in order to properly segregate
code/modules in different projects. I am however having problems with
my django installations not using site-packages within the virtualenv
but rather attempting to use site-packages in the default python
installation directory.

Recreating the problem:

1) Install Python 2.7 via the Windows installer. Add C:/Python27;C:/
Python27/Scripts to Windows PATH.
2) Install setuptools-0.6c11-py2.7.egg via the Windows installer.
3) Install VirtualEnv through `pip install virtualenv`
4) Create an VirtualEnv via `virtualenv --no-site-packages MyEnvName`
5) Activate VirtualEnv via `../MyEnvName/Scripts/activate.bat`
6) Install django via `pip install django`
7) Run django-admin.py startproject ProjectName
Error results stating django.core module does not exist.

NB: This error will not occur if django is installed in your root
directory.
NB2: Running the Python interpreter in active VirtualEnv to print the
sys.path shows the correct paths. Which has just futher added to my
confusion.

I'd appreciate any insight or troubleshooting assistance.

Thanks

Ash
 
Reply With Quote
 
 
 
 
ashconnor
Guest
Posts: n/a
 
      07-12-2010
I've resolved this issue by deleting the *.py file association in
Windows.

You can do this either by associating *.py with something like
textpad, using a utility such as http://defaultprogramseditor.com/ or
doing so in the registry.

Note that when using the command like you need to issue commands with
a preceding `python` keyword.

For example in a normal installation enviroment the following is
possible `django-admin.py startproject MyProject`, however in a
VirtualEnv with *.py associations removed one must do `python django-
admin.py startproject MyProject` otherwise Windows will attempt to
open the file in the default application even if there isn't one.

Thanks,

Ash

On Jul 12, 1:55*am, ashconnor <(E-Mail Removed)> wrote:
> Hello,
>
> After reading 'Practical Django Projects' I decided that I want to
> implement the VirtualEnv tip suggested in order to properly segregate
> code/modules in different projects. I am however having problems with
> my django installations not using site-packages within the virtualenv
> but rather attempting to use site-packages in the default python
> installation directory.
>
> Recreating the problem:
>
> 1) Install Python 2.7 via the Windows installer. Add C:/Python27;C:/
> Python27/Scripts to Windows PATH.
> 2) Install setuptools-0.6c11-py2.7.egg via the Windows installer.
> 3) Install VirtualEnv through `pip install virtualenv`
> 4) Create an VirtualEnv via `virtualenv --no-site-packages MyEnvName`
> 5) Activate VirtualEnv via `../MyEnvName/Scripts/activate.bat`
> 6) Install django via `pip install django`
> 7) Run django-admin.py startproject ProjectName
> Error results stating django.core module does not exist.
>
> NB: This error will not occur if django is installed in your root
> directory.
> NB2: Running the Python interpreter in active VirtualEnv to print the
> sys.path shows the correct paths. Which has just futher added to my
> confusion.
>
> I'd appreciate any insight or troubleshooting assistance.
>
> Thanks
>
> Ash

 
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
running in a virtualenv Andrea Crotti Python 0 01-26-2012 11:16 AM
ipython installed in virtualenv seems not to use virtualenv Gelonida N Python 4 08-11-2011 11:06 AM
Re: PyChecker under python's virtualenv Diez B. Roggisch Python 2 02-04-2010 08:41 AM
virtualenv under Win7: easy_install fails in virtual environments Guillermo Python 1 10-26-2009 07:21 PM
virtualpython / workingenv / virtualenv ... shouldn't this be part of python Damjan Python 5 01-15-2008 08:57 AM



Advertisments