无法在pipenv shell中运行Django

时间:2018-05-07 20:19:25

标签: django pipenv

如果我跑:

$ pipenv install django
$ pipenv shell
(user-nKDraKU3) $ python manage.py shell

我得到一个ModuleNotFoundError:

Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

...
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

当我处于“激活的”pipenv环境时,这应该不起作用吗?但是,这很好用:

$ pipenv run python manage.py shell
Python 3.6.5rc1 (default, Mar 14 2018, 06:54:23)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>

0 个答案:

没有答案