• python 命令运行环境下 ModuleNotFoundError: No module named 'Test'


    解决方法有两种

    1. 第一种设置环境变量法

    on windows the line is :
    SET PYTHONPATH=%cd%;%cd%Test
    NOT
    SET PYTHONPATH=%cd%:%cd%Test
    You can test with :
    echo %PYTHONPATH%
     
     2.第二种方法
     
    进入 python 运行环境
    import sys
    import os
    curPath = os.path.abspath(os.path.dirname(__file__))
    rootPath = os.path.split(curPath)[0]
    sys.path.append(rootPath)
  • 相关阅读:
    重装Win10系统的非常简单的操作教程
    Python
    Delphi
    Libs
    Windows Server
    Windows Server
    Delphi
    Delphi
    Delphi
    Delphi
  • 原文地址:https://www.cnblogs.com/gylhaut/p/9889917.html
Copyright © 2020-2023  润新知