作者:lchakjet | 来源:互联网 | 2023-05-19 15:42
InmysystemthereisDjango1.2.3installedsystemwide:在我的系统中有Django1.2.3安装系统:C:\>python-c
In my system there is Django 1.2.3 installed system wide:
在我的系统中有Django 1.2.3安装系统:
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的虚拟环境,我在其中安装了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:
我的问题:
- Why django-admin.py reports version 1.2.3, if the current Python (virtual) environment has django 1.2.4 installed?
- 为什么django-admin。py报告版本1.2.3,如果当前的Python(虚拟)环境已经安装了django 1.2.4 ?
- How can I use Django's 1.2.4 django-admin.py automatically when venv is active?
- 我如何使用Django的1.2.4 Django -admin。当venv激活时,py自动生效?
Additional info:
额外的信息:
- virtualenv version: 1.5.1, Python version 2.7
- virtualenv版本:1.5.1,Python版本2.7
- command used to create venv:
C:\dev\> virtualenv --no-site-packages venv
- 用于创建venv: C:\dev\> virtualenv——无站点包的venv的命令
(venv) C:\> echo %PATH%
(venv)C:\ % >回声%路径
C:\dev\venv\Scripts; ...other paths...
C:\开发\ venv \脚本;…其他路径…
shebang of django-admin.py in venv: #!C:\dev\Scripts\python.exe
django-admin的住所。py venv:# ! C:\开发\ \ python.exe的脚本
Hope you can help, many thanks.
希望你能帮忙,非常感谢。
6 个解决方案