這裏是我的python manage.py runserver
錯誤跟蹤我使用的Django 1.10.7與蟒蛇2.7Django的 - 導入錯誤:沒有模塊名爲djangochat.settings
(faavenv) [email protected]:~/Documents/faa-backend$ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_from_command_line(sys.argv)
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 316, in execute
settings.INSTALLED_APPS
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 97, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named djangochat.settings
這裏是我的requirements.txt
amqp==2.2.1
anyjson==0.3.3
asn1crypto==0.22.0
Babel==2.4.0
backports-abc==0.5
bcrypt==3.1.3
BeautifulSoup==3.2.1
beautifulsoup4==4.6.0
billiard==3.5.0.3
bleach==2.0.0
boto==2.48.0
boto3==1.4.4
botocore==1.5.80
celery==4.1.0
certifi==2017.4.17
cffi==1.10.0
chardet==3.0.4
cryptography==1.9
Django==1.10.7
django-celery-beat==1.0.1
django-contrib-comments==1.8.0
django-debug-toolbar==1.8
django-environ==0.4.3
django-nocaptcha-recaptcha==0.0.19
django-storages-redux==1.3.3
docutils==0.13.1
enum34==1.1.6
Fabric==1.13.2
feedparser==5.2.1
filebrowser-safe==0.4.7
flower==0.9.2
future==0.16.0
futures==3.1.1
grappelli-safe==0.4.6
html5lib==0.999999999
idna==2.5
ipaddress==1.0.18
jmespath==0.9.3
kombu==4.1.0
Mezzanine==4.2.3
nltk==3.2.4
numpy==1.13.0
oauthlib==2.0.2
olefile==0.44
pandas==0.20.2
paramiko==2.2.1
Pillow==4.1.1
psycopg2==2.7.1
pyasn1==0.2.3
pycparser==2.17
pycryptodomex==3.4.6
pyjwkest==1.3.6
PyJWT==1.5.2
PyNaCl==1.1.2
python-dateutil==2.6.0
python-openid==2.2.5
pytz==2017.2
requests==2.18.1
requests-oauthlib==0.8.0
s3transfer==0.1.10
scikit-learn==0.18.2
scipy==0.19.1
singledispatch==3.4.0.3
six==1.10.0
sklearn==0.0
social-auth-app-django==1.2.0
social-auth-core==1.4.0
sqlparse==0.2.3
tornado==4.5.1
tzlocal==1.4
urllib3==1.21.1
vine==1.1.4
webencodings==0.5.1
問題是我沒有在我的環境中安裝Django聊天。不過,它顯示出上述錯誤。不僅這個項目,而且在所有項目中,我都收到了這個錯誤。
我試圖重新安裝所有庫,但沒有幫助。
任何建議,將不勝感激。
(faavenv) [email protected]:~/Documents/faa-backend$ python manage.py shell
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_from_command_line(sys.argv)
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 316, in execute
settings.INSTALLED_APPS
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/home/user/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/home/soham/Documents/faa-backend/faavenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 97, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named djangochat.settings
(faavenv) [email protected]:~/Documents/faa-backend$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import djangoChat
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named djangoChat
>>>
如果您運行'manage.py shell'並嘗試'import djangoChat',你會得到什麼? – Haranadh
@Haranadh我已經用你建議的命令的輸出更新了我的問題。 –
是你在djangochat目錄下的設置文件嗎?目錄是否存在? –