1

I moved this app from Windows to Mac. It was working fine on windows. After that I ran pip install -t lib requirements.txt And now getting this error.

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

So, I did pip install -t lib --upgrade google-cloud-bigquery and got below error

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'

Then used sudo pip install -t lib --upgrade google-cloud-bigquery. The install was successful but I get the same original error again. No module named google.cloud.bigquery

sam
  • 347
  • 2
  • 10
  • 26
  • all sorts of errors I am getting now. It seems to me that I have somehow messed up my python version when i migrated windows app and installed the packages from requirements.txt that was frozen on windows. Is there any way to clean up all python packages and have a fresh start – sam Oct 02 '17 at 20:57
  • how many python versions do you have installed, and what is your default set to e.g run `python` and look at the version. – Graham Polley Oct 03 '17 at 00:23
  • Perhaps try to [delete all your pip packages](https://stackoverflow.com/a/11250821/516942) and try installation again? – Victor Mota Oct 03 '17 at 01:24
  • I suspect you have 3.x installed too, and that's where pip is installing. Try installing to a specific version - https://stackoverflow.com/questions/2812520/pip-dealing-with-multiple-python-versions – Graham Polley Oct 03 '17 at 07:55
  • I only have Python 2.7 installed. @VictorMota getting error . while deleting packages OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/Flask-0.12.2.dist-info/DESCRIPTION.rst' – sam Oct 03 '17 at 19:05

0 Answers0