python:无法打开文件'.manage.py':[Errno 2]没有这样的文件或目录

时间:2020-11-07 21:11:49

标签: python django

我正在学习Django,但出现此错误:

python: can't open file '.manage.py': [Errno 2] No such file or directory

跑步时

python .\manage.py makemigrations

我知道我在与manage.py文件相同的文件夹中运行命令,那么可能是什么问题?

这是我的目录树:

.
├── api
│   ├── admin.py
│   ├── apps.py
│   ├── __init__.py
│   ├── migrations
│   │   └── __init__.py
│   ├── models.py
│   ├── tests.py
│   ├── urls.py
│   └── views.py
├── manage.py
└── music_controller
    ├── asgi.py
    ├── __init__.py
    ├── settings.py
    ├── urls.py
    └── wsgi.py

这是我在上面的命令中运行的密码:

(djangotut) ether@ether:~/Documents/django-react-tutorial/music_controller$ 

1 个答案:

答案 0 :(得分:2)

您无需在路径中使用反斜杠。 正确的命令应该是:python manage.py makemigrations

自然,您将在manage.py所在的目录中使用它。

相关问题