zoukankan      html  css  js  c++  java
  • python运行的时候报错line 192, in _run_module_as_main return _run_code(code, main_globals, None,

    用的pytone3.8,很久没有搞python了,用vscode运行以前的py代码居然报错:

    Traceback (most recent call last):
      File "C:Program Files (x86)PythonPython38-32lib
    unpy.py", line 192, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:Program Files (x86)PythonPython38-32lib
    unpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "c:Userszw.vscodeextensionsms-python.python-2020.2.64397pythonFileslibpython
    ew_ptvsd
    o_wheelsptvsd\__main__.py", line 45, in <module>
        cli.main()
      File "c:Userszw.vscodeextensionsms-python.python-2020.2.64397pythonFileslibpython
    ew_ptvsd
    o_wheelsptvsd/..ptvsdservercli.py", line 361, in main
        run()
      File "c:Userszw.vscodeextensionsms-python.python-2020.2.64397pythonFileslibpython
    ew_ptvsd
    o_wheelsptvsd/..ptvsdservercli.py", line 203, in run_file
      File "C:Program Files (x86)PythonPython38-32lib
    unpy.py", line 262, in run_path
        return _run_module_code(code, init_globals, run_name,
      File "C:Program Files (x86)PythonPython38-32lib
    unpy.py", line 95, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "C:Program Files (x86)PythonPython38-32lib
    unpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "e:pythonCodecheckUrl.py", line 1, in <module>
        import test1.myHttp as my
    ModuleNotFoundError: No module named 'test1'

    解决办法

    管理员身份运行cmd

    使用命令:  pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

    再执行:python -m pip install --upgrade pip

    再运行代码就可以了

  • 相关阅读:
    第六章:单元测试框架unittest
    Jenkins 使用 war包安装时,如果出现报离线错误解决方法
    Appium自动化封装教案
    yaml文件读取(5.1之前与5.1之后对比)
    appium-desktop配置运用方法
    postwoman 配置
    jwt解析
    pytest
    centos安装python3.8
    linux 查找命令
  • 原文地址:https://www.cnblogs.com/q149072205/p/13187269.html
Copyright © 2011-2022 走看看