###前提・実現したいこと
python manage.py schemamigration MyApp --initial
(MyAppは自分がDjangoで作ったアプリ名です。)
をエラーなく実行したい。
###発生している問題・エラーメッセージ
MySQlとpythonを連携していることを確認(>>>import MySQLdbでエラーなし)
Djangoのsettings.pyにsouthを読み込む、mySQLDBの登録など必要事項記入後に、
Migrationを実行しようとしました
$ ls MyApp manage.py mysite $ python manage.py schemamigration MyApp --initial Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line utility.execute() File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 324, in execute django.setup() File "/Library/Python/2.7/site-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/Library/Python/2.7/site-packages/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 South
と、「southがない」と、エラーになってしまいます。
###試したこと
パイソンのパスが通っていない可能性があるという記述を見ましたので、
$python >>>import sys >>>sys.path
と、してパスを確認したところ、
'', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages'
と、出てきました。
/Library/Python/2.7/site-packages にsouthのフォルダがあったので、なぜパスが通っているのにエラーになるのかわかりません。
どなたか原因と改善策分かる方いらっしゃいますでしょうか。お願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/08/19 00:55