[英]Django for Mongodb can't find django-admin.py
I am starting to learn to use MongoDB with Django , so I followed this tutorial to start up. 我开始学习将MongoDB与Django结合使用,因此我按照本教程进行了启动。
I created my virtual environment using python3.6 -m venv MongodbTestVenv
, and activated it using source MongodbTestVenv/bin/activate
. 我使用python3.6 -m venv MongodbTestVenv
创建了虚拟环境,并使用source MongodbTestVenv/bin/activate
。 Everything worked fine, so far. 到目前为止,一切正常。
I installed Django-nonrel using pip install git+https://github.com/django-nonrel/django@nonrel-1.5
. 我使用pip install git+https://github.com/django-nonrel/django@nonrel-1.5
安装了Django-nonrel 。
I installed djangotoolbox using pip install git+https://github.com/django-nonrel/djangotoolbox
. 我使用pip install git+https://github.com/django-nonrel/djangotoolbox
安装了djangotoolbox 。
I installed Mongo DB engine using pip install git+https://github.com/django-nonrel/mongodb-engine
. 我使用pip install git+https://github.com/django-nonrel/mongodb-engine
安装了Mongo DB引擎 。
I checked with pip list
to ensure everything is installed: 我检查了pip list
以确保已安装所有内容:
(MongodbTestVenv) MacBook-Pro-de-Hugo:MongodbTestProject hugovillalobos$ pip list
Package Version
--------------------- -------
Django 1.5.11
django-mongodb-engine 0.6.0
djangorestframework 3.9.2
djangotoolbox 1.8.0
pip 19.0.3
pymongo 3.7.2
setuptools 28.8.0
But, when I type django-admin startproject MongodbTest
, I get this error: -bash: django-admin: command not found
. 但是,当我键入django-admin startproject MongodbTest
,出现此错误: -bash: django-admin: command not found
。
I checked this question , but all answer are related to the location of django-admin.py file, so I found it using which django-admin.py
, and this is the result: 我检查了这个问题 ,但是所有答案都与django-admin.py文件的位置有关,因此我使用which django-admin.py
找到了它,结果是:
(MongodbTestVenv) MacBook-Pro-de-Hugo:MongodbTestProject hugovillalobos$ which django-admin.py
/Users/hugovillalobos/Documents/Code/MongodbTestProject/MongodbTestVenv/bin/django-admin.py
I can see that the file is located on the active virtual environment directory, so I can't understand why it can't be located. 我可以看到该文件位于活动的虚拟环境目录中,因此我无法理解为什么找不到该文件。
I don't know what I am missing, I have never had problems with Django when using relational database and I install regular Django versions using just pip install Django
. 我不知道我缺少什么,使用关系数据库时我从未遇到过Django问题,我只使用pip install Django
安装了常规Django版本。
You say you ran: 你说你跑了:
django-admin startproject MongodbTest
but your bash is able to find django-admin.py
from that which
statement. 但你的bash是能够找到django-admin.py
从which
声明。
Try what your bash knows: 尝试您的bash知道的内容:
django-admin.py startproject MongodbTest
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.