我有以下python文件。
import sys
sys.path.insert(1, '/usr/local/google_appengine')
sys.path.insert(1, '/Users/vinay/google-cloud-sdk/platform/google_appengine/')
sys.path.insert(1, '/Users/vinay/google-cloud-sdk/platform/google_appengine/lib/yaml/lib')
from google.appengine.api import users
这是一个单元测试python文件。
但是,当我运行单元测试时,我收到以下错误
/Users/vinay/App-Engine/xxxx/x/env/bin/python xxx/Applications/PyCharm.app/Contents/helpers/pycharm/utrunner.py /Users/vinay/App-Engine/xxxx/x/tests/test_oauth2callback.py::TestOauth2callback true
Testing started at 10:12 PM ...
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pycharm/utrunner.py", line 129, in <module>
module = loadSource(a[0])
File "/Applications/PyCharm.app/Contents/helpers/pycharm/utrunner.py", line 43, in loadSource
module = imp.load_source(moduleName, fileName)
File "/Users/vinay/App-Engine/xxxx/x/tests/test_oauth2callback.py", line 6, in <module>
from google.appengine.api import users
ImportError: No module named appengine.api
Process finished with exit code 1