I finished my Virtual environment setup in Python. I didn't have django in pip list, but i can still create django project using django-admin command

huangapple go评论87阅读模式
英文:

I finished my Virtual environment setup in Python. I didn't have django in pip list, but i can still create django project using django-admin command

问题

以下是翻译好的部分:

pip list:
包名 版本


pip 23.1.2
setuptools 58.1.0

在我的虚拟环境中没有django,但django-admin命令仍然可以正常工作!这是如何可能的。

提前感谢清晰的回答。

我尝试在lib文件夹中查找django包,但仍然没有包与django相关。

英文:

pip list:
Package Version


pip 23.1.2
setuptools 58.1.0

it doesn't have django in My Virtual environment but still django-admin commands worked for me! how is that possible.

Thank you for clear answers in advance

i Tried finding django package in lib folder but still doesn't contain any packages related to django

答案1

得分: 3

It looks likely that Django is installed globally on your system.

英文:

it is looks likely that Django is installed globally on your system.

答案2

得分: 0

创建虚拟环境的目的是创建一个与您的“虚拟环境”隔离的系统。这种关系应该从各个方向看得到,其他系统不会与“虚拟”环境通信。除非另有编程,但这不是情况。

如果运行'django-admin'并且终端能理解您的意思,这意味着该特定终端知道您想要什么。在您的情况下,django-admin已经安装在您的系统上,因为您在虚拟环境之外执行了 pip install django

始终注意正在使用哪个 shell。

PS C:\Users>

“PS”= PowerShell

(Playground) PS C:\Users\

($PROJECT_NAME) PS = 使用 PowerShell 的 pipenv

英文:

When creating a virtual environment, the purpose is to create an isolated system that is separate from the rest of your "virtual environment." This relationship should be seen from all directions, other systems won’t communicate with the “virtual” environment. Unless programmed otherwise, but this is not the case.

If you run ‘django-admin’ and the terminal understands what you want it means that this SPECIFIC terminal knows what you want. In your case, the django-admin is already installed on your system since you executed pip install django outside your virtual environment.

Always pay attention to which shell is being used.

PS C:\Users>

“PS” = PowerShell

(Playground) PS C:\Users\

($PROJECT_NAME) PS = pipenv with PowerShell

huangapple
  • 本文由 发表于 2023年5月18日 00:48:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76274431.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定