在执行  python manage.py  runserver 命令时,报错:  can't open file 'manage.py': [Errno 2] No such file or directory,

这种错误意思是找不到  manage.py 这个文件, 但在phcharm的项目中,可以看到这个文件是存在的:

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

   仔细观察,当前目录是在pyshop下,使用dir命令看下当前目录下有什么:

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

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

 当前目录下并没有manage.py这个文件, 进入pyshop下再看看:

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

可以看到,在pyshop下是有 manage.py的,接下来,在 pyshop这个目录下,再执行刚才的命令,应该就可以了:

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

如上图,结果正常了。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-31
  • 2021-11-20
  • 2022-12-23
  • 2021-09-21
  • 2022-12-23
猜你喜欢
  • 2021-07-24
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2021-06-14
  • 2021-09-13
相关资源
相似解决方案