py manage.py makemigrations [project_name]我在使用and命令时遇到问题py manage.py migrate。每次我以正确的顺序尝试这两个命令时,都会收到以下错误:
Traceback (most recent call last):
File "C:\Users\Gilbert\PycharmProjects\GGprojects\django\manage.py", line 20, in <module>
main()
File "C:\Users\Gilbert\PycharmProjects\GGprojects\django\manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\Gilbert\PycharmProjects\GGprojects\django\ll_env\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
utility.execute()
File "C:\Users\Gilbert\PycharmProjects\GGprojects\django\ll_env\lib\site-packages\django\core\management\__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\Gilbert\PycharmProjects\GGprojects\django\ll_env\lib\site-packages\django\core\management\base.py", line 301, in run_from_argv
connections.close_all()
File "C:\Users\Gilbert\PycharmProjects\GGprojects\django\ll_env\lib\site-packages\django\db\utils.py", line 225, in close_all
connection.close()
File "C:\Users\Gilbert\PycharmProjects\GGprojects\django\ll_env\lib\site-packages\django\db\backends\sqlite3\base.py", line 190, in close
if not self.is_in_memory_db():
File "C:\Users\Gilbert\PycharmProjects\GGprojects\django\ll_env\lib\site-packages\django\db\backends\sqlite3\base.py", line 287, in is_in_memory_db
return self.creation.is_in_memory_db(self.settings_dict['NAME'])
File "C:\Users\Gilbert\PycharmProjects\GGprojects\django\ll_env\lib\site-packages\django\db\backends\sqlite3\creation.py", line 13, in is_in_memory_db
return database_name == ':memory:' or 'mode=memory' in database_name
TypeError: argument of type 'WindowsPath' is not iterable
查看错误,我会说我的 Python 路径可能不正确。它的当前路径是C:\Users\Gilbert\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.9. 这是出现错误的原因吗?它会影响我的 Django 项目吗?另外,我该如何解决这个问题?
MYYA
相关分类