In my system there is Django 1.2.3 installed system wide:
C:\>python -c "import django; print django.get_version()"
1.2.3
C:\>django-admin.py --version
1.2.3
Then there is a virtual environment called venv in C:\dev where I installed Django 1.2.4:
C:\> dev\venv\Scripts\activate.bat
(venv) C:\> python -c "import django; print django.get_version()"
1.2.4
(venv) C:\> django-admin.py --version
1.2.3
My questions:
Additional info:
C:\dev\> virtualenv --no-site-packages venv
(venv) C:\> echo %PATH%
C:\dev\venv\Scripts; ...other paths...
shebang of django-admin.py in venv: #!C:\dev\Scripts\python.exe
Hope you can help, many thanks.
'django-admin' is not recognized as an internal or external command, operable program or batch file. To fix this, first close the terminal window and relaunch it with administrator privileges. Once you launch the elevated terminal window change directory to where you wish to start your Django project.
This is because your windows has associated .py
extension with the globally installed python.exe
. Therefore when you type django-admin.py
, even though you're in a virtualenv, the global python is invoked, and it in turn finds your global django installation in its own site-packages. Try python django-admin.py
to circumvent the association.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With