解决方法有两种

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)

相关文章:

  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2021-05-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2021-07-21
  • 2021-07-29
  • 2021-06-18
  • 2022-01-27
相关资源
相似解决方案