When you type 'django-admin.py foo' in a command prompt, windows will use
the system wide python install which is what is associated with the .py
extension. In order to avoid this, you must call 'python django-admin.py
foo'.

If you don't like having to type 'python' before calling a script, you can
alter your virtualenv activate script so that window's file association for
Python files gets changed when a new environment gets activated. This has
the downside of not reverting the association when you close a prompt
without properly deactivating (by typing 'deactivate'), but I still like
it, so there's a how-to below.


In order to tell the virtualenv to use your virtual python install when
calling file.py directly, you need to modify the activate.bat script and
add the following line somewhere in the beginning (after @echo off):

FTYPE Python.File="C:\Environments\django1.3\Scripts\python.exe" "%1" %*

Then add a line to revert this association change in deactivate.bat
(located in the same folder):

FTYPE Python.File="C:\Python27\python.exe" "%1" %*

I did my best to guess the paths, but you might have to adjust them
appropriately.


Hope that helps!

Cheers,
AT

On Wed, Apr 4, 2012 at 6:01 AM, DIEGO CENZANO PRADO
<diego.cenz...@bbva.com>wrote:

> I have install django with 'python setup.py install' in a virtual
> environment called 'django1.3'
>
> I run it and receive the following error mesage:
>
> (django1.3) C:\Documentos de Diego\Dropbox\Codigo\Django>django-admin.py
>
> Traceback (most recent call last):
>
>   File "C:\Environments\django1.3\Scripts\django-admin.py", line 2, in
> <module>
>
>     from django.core import management
>
> ImportError: No module named django.core
> Can anybody help me, please?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/WKzPnfWfh9UJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to