0
私はPython 2.7と3.5の両方をインストールしています。 djangoプロジェクトを作成する際に、Python 3.5をPythonインタプリタとして選択しました。また、残りのフレームワークもインストールしましたが、私のdjangoプロジェクトを実行中にこのエラーが見つかりました。ヘルプImportError:いいえモジュール名rest_framework
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Library/Python/2.7/site-packages/Django-1.10-py2.7.egg/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/Library/Python/2.7/site-packages/Django-1.10-py2.7.egg/django/core/management/__init__.py", line 341, in execute
django.setup()
File "/Library/Python/2.7/site-packages/Django-1.10-py2.7.egg/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Library/Python/2.7/site-packages/Django-1.10-py2.7.egg/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Library/Python/2.7/site-packages/Django-1.10-py2.7.egg/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named rest_framework
あなたはvirtualenvを使用していますか?その場合は、virtualenvを有効にしてください。 – arcegk
python3.5を選択しましたが、python2.7を実行中であることを示すエラーが表示されました。私は通訳者の選択を正しくしたのですか? –