ImportError:没有名为google.cloud.bigquery的模块

时间:2017-10-02 17:49:20

标签: python-2.7 google-bigquery

我将此应用从Windows移至Mac。它在Windows上运行良好。 之后我跑了pip install -t lib requirements.txt 现在得到这个错误。

Traceback (most recent call last): File "/Users/sa/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) File "/Users/sa/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler handler, path, err = LoadObject(self._handler) File "/Users/sa/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject obj = __import__(path[0]) File "/Users/sa/Documents/GitHub/ga/main.py", line 4, in <module> from importer import import_report_data, generate_csv File "/Users/sa/Documents/GitHub/ga/importer.py", line 2, in <module> import bq_client File "/Users/sa/Documents/GitHub/ga/bq_client.py", line 3, in <module> from google.cloud import bigquery File "/Users/sa/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 1061, in load_module raise ImportError('No module named %s' % fullname) ImportError: No module named google.cloud.bigquery

所以,我做了pip install -t lib --upgrade google-cloud-bigquery并得到了以下错误

Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 423, in run shutil.rmtree(target_item_dir) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 252, in rmtree onerror(os.remove, fullname, sys.exc_info()) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 250, in rmtree os.remove(fullname) OSError: [Errno 13] Permission denied: '/Users/sa/Documents/GitHub/ga/lib/cachetools/__init__.py'

然后使用sudo pip install -t lib --upgrade google-cloud-bigquery。安装成功但我再次得到相同的原始错误。 No module named google.cloud.bigquery

0 个答案:

没有答案