【问题标题】:Django web project not runningDjango Web 项目未运行
【发布时间】:2022-01-13 09:37:48
【问题描述】:
  1. 我的 Web 应用程序没有在新系统上运行,它说它不能将“python”/“pip 识别为内部和外部命令。

  2. 我的 Powershell 终端

     '''
       PS C:\Users\Nawaf  Bhatti\Desktop\learn> python -m pip install pillow
       python: The term 'python' is not recognized as the name of a cmdlet, function, script 
       file, or operable program. Check the spelling 
       of the name, or if a path was included, verify that the path is correct and try again.
       At line:1 char:1
       + python -m pip install pillow
         + ~~~~~~
       + CategoryInfo          : ObjectNotFound: (python:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
      '''
    
  3. 我的命令

       '''
       C:\Users\Nawaf  Bhatti\Desktop\learn\web_app>python manage.py runserver
        'python' is not recognized as an internal or external command,
      operable program or batch file.
      '''
    

【问题讨论】:

    标签: python django virtualenv


    【解决方案1】:

    那是因为你的电脑没有接python安装,

    尝试运行命令

    python --version
    

    它应该回复安装的python版本:

    Python 3.9.9
    

    如果发生错误,请尝试在cmd中运行以下命令:

    python3 --version
    

    如果随后出现版本,则意味着您必须运行代码:

    python3 manage.py runserver
    

    或者去微软商店安装python,然后运行上面的命令,如果出现你的版本,那么你就可以恢复正常的服务器运行方式

    这是您 Microsoft 商店中python 的链接

    【讨论】:

    • 仍然无法识别
    • 现有项目中如何激活virtualenv?
    猜你喜欢
    • 1970-01-01
    • 2018-05-15
    • 1970-01-01
    • 2018-05-24
    • 1970-01-01
    • 1970-01-01
    • 2022-07-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多