Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【部署报错】在pycharm执行正常,在命令行窗口报错No module named 'base' #11

Open
Valuebai opened this issue Feb 4, 2020 · 1 comment

Comments

@Valuebai
Copy link
Owner

Valuebai commented Feb 4, 2020

解决方案:在run_test.py文件最前面加上以下代码,必须放在所有improt之前!!!!!

import sys
import os
curPath = os.path.abspath(os.path.dirname(file))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)

@Valuebai
Copy link
Owner Author

Valuebai commented Jul 2, 2020

或者
import sys
sys.path.append('..')
在from xxx import之前加上这句

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant