I recently formatted my PC and reisntalled Python 2.7, Google Cloud SDK with the App Engine component and PyCharm as an IDE.
The App Engine SDK works normally, but I cannot run unit tests locally, neither from PyCharm nor form the command prompt, which worked before the format and reinstallation.
I get this error:
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.6\helpers\pycharm\utrunner.py", line 124, in
module = loadSource(a[0])
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.6\helpers\pycharm\utrunner.py", line 40, in loadSource
module = imp.load_source(moduleName, fileName)
File "C:\Users---\Documents\App Engine apps---\test.py", line 24, in
import webtest
ImportError: No module named webtest
Test.py imports webtest and unittest and runs the tests.
I set a PYTHONPATH user env var (I am using Windows 7) accordingly and in fact the directories in ´sys.path´ are:
C:\Users\---\Documents\App Engine apps\--- (project dir, user and project name omitted)
C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine
C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib
C:\Windows\system32\python27.zip, C:\Python27\DLLs, C:\Python27\lib, C:\Python27\lib\plat-win, C:\Python27\lib\lib-tk, C:\Python27, C:\Python27\lib\site-packages
Where the 2nd and 3rd entries are the directories to the App Engine libraries (Webtest is located on "[...]\google_appengine\lib"), but for some reason the Python interpreter cannot find and import them.
I can't for the love of my life get Python to recognize these App Engine modules, import them and run the unit tests as it did before the reinstallation. Thank you very much in advance.
Aucun commentaire:
Enregistrer un commentaire