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

Packaging: Cannot install google==1.9.3 alongside other "google-*" libs via pip install -r ./requirements.txt #4345

Closed
zafields opened this issue Nov 4, 2017 · 10 comments
Assignees
Labels
packaging priority: p2 Moderately-important priority. Fix may not be included in next release. type: process A process-related concern. May include testing, release, or the like.

Comments

@zafields
Copy link

zafields commented Nov 4, 2017

SETUP

OS: macOS Sierra 10.12.6
Docker: Version 17.09.0-ce-mac35 (19611)
Docker Env: Ubuntu-14.04 w/ Python 2.7.6 (--enable-unicode=ucs4)

I'm encountering an error during the RUN ["/bin/bash","-c","pip install -r ./requirements.txt"] instruction.

Here's a snippet from the requirements.txt file:

...
google==1.9.3
google-apitools==0.4.11
google-api-python-client==1.4.2
google-cloud-storage==1.1.1
...

OBSERVATION

Individually...

google==1.9.3

or

google-apitools==0.4.11
google-api-python-client==1.4.2
google-cloud-storage==1.1.1

install correctly, but once they are installed at the same time, I begin to have the following errors...

ERRORS

pip starts emitting warnings when it's installing the google related packages...

    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution

... then eventually results in the following error.

  Traceback (most recent call last):

    File "/usr/lib/python2.7/site.py", line 158, in addpackage

      exec line

    File "<string>", line 1, in <module>

  KeyError: 'google'

LOGS FOR CONTEXT

PRELIMINARY WARNINGS

Downloading/unpacking google-gax>=0.15.7,<0.16dev (from google-cloud-bigtable>=0.26.0,<0.27dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Running setup.py (path:/tmp/pip_build_root/google-gax/setup.py) egg_info for package google-gax
    
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/unpacking gapic-google-cloud-pubsub-v1>=0.15.0,<0.16dev (from google-cloud-pubsub>=0.27.0,<0.28dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading gapic-google-cloud-pubsub-v1-0.15.4.tar.gz
  Running setup.py (path:/tmp/pip_build_root/gapic-google-cloud-pubsub-v1/setup.py) egg_info for package gapic-google-cloud-pubsub-v1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    no previously-included directories found matching '.tox'
Downloading/unpacking gapic-google-cloud-datastore-v1>=0.15.0,<0.16dev (from google-cloud-datastore>=1.2.0,<1.3dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading gapic-google-cloud-datastore-v1-0.15.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/gapic-google-cloud-datastore-v1/setup.py) egg_info for package gapic-google-cloud-datastore-v1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    no previously-included directories found matching '.tox'
Downloading/unpacking gapic-google-cloud-logging-v2>=0.91.0,<0.92dev (from google-cloud-logging>=1.2.0,<1.3dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading gapic-google-cloud-logging-v2-0.91.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/gapic-google-cloud-logging-v2/setup.py) egg_info for package gapic-google-cloud-logging-v2
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    no previously-included directories found matching '.tox'
Downloading/unpacking gapic-google-cloud-spanner-v1>=0.15.0,<0.16dev (from google-cloud-spanner>=0.26.0,<0.27dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading gapic-google-cloud-spanner-v1-0.15.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/gapic-google-cloud-spanner-v1/setup.py) egg_info for package gapic-google-cloud-spanner-v1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    no previously-included directories found matching '.tox'
Downloading/unpacking gapic-google-cloud-spanner-admin-database-v1>=0.15.0,<0.16dev (from google-cloud-spanner>=0.26.0,<0.27dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading gapic-google-cloud-spanner-admin-database-v1-0.15.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/gapic-google-cloud-spanner-admin-database-v1/setup.py) egg_info for package gapic-google-cloud-spanner-admin-database-v1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    no previously-included directories found matching '.tox'
Downloading/unpacking gapic-google-cloud-spanner-admin-instance-v1>=0.15.0,<0.16dev (from google-cloud-spanner>=0.26.0,<0.27dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading gapic-google-cloud-spanner-admin-instance-v1-0.15.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/gapic-google-cloud-spanner-admin-instance-v1/setup.py) egg_info for package gapic-google-cloud-spanner-admin-instance-v1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    no previously-included directories found matching '.tox'
Downloading/unpacking gapic-google-cloud-error-reporting-v1beta1>=0.15.0,<0.16dev (from google-cloud-error-reporting>=0.26.0,<0.27dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading gapic-google-cloud-error-reporting-v1beta1-0.15.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/gapic-google-cloud-error-reporting-v1beta1/setup.py) egg_info for package gapic-google-cloud-error-reporting-v1beta1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    no previously-included directories found matching '.tox'
Downloading/unpacking dill>=0.2.5,<0.3dev (from google-gax>=0.15.7,<0.16dev->google-cloud-bigtable>=0.26.0,<0.27dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Running setup.py (path:/tmp/pip_build_root/dill/setup.py) egg_info for package dill
    
Downloading/unpacking ply==3.8 (from google-gax>=0.15.7,<0.16dev->google-cloud-bigtable>=0.26.0,<0.27dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Running setup.py (path:/tmp/pip_build_root/ply/setup.py) egg_info for package ply
    
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/unpacking proto-google-cloud-pubsub-v1[grpc]>=0.15.4,<0.16dev (from gapic-google-cloud-pubsub-v1>=0.15.0,<0.16dev->google-cloud-pubsub>=0.27.0,<0.28dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading proto-google-cloud-pubsub-v1-0.15.4.tar.gz
  Running setup.py (path:/tmp/pip_build_root/proto-google-cloud-pubsub-v1/setup.py) egg_info for package proto-google-cloud-pubsub-v1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
  Installing extra requirements: u'grpc'
Downloading/unpacking grpc-google-iam-v1>=0.11.1,<0.12dev (from gapic-google-cloud-pubsub-v1>=0.15.0,<0.16dev->google-cloud-pubsub>=0.27.0,<0.28dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading grpc-google-iam-v1-0.11.4.tar.gz
  Running setup.py (path:/tmp/pip_build_root/grpc-google-iam-v1/setup.py) egg_info for package grpc-google-iam-v1
    
Downloading/unpacking proto-google-cloud-datastore-v1[grpc]>=0.90.3,<0.91dev (from gapic-google-cloud-datastore-v1>=0.15.0,<0.16dev->google-cloud-datastore>=1.2.0,<1.3dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading proto-google-cloud-datastore-v1-0.90.4.tar.gz
  Running setup.py (path:/tmp/pip_build_root/proto-google-cloud-datastore-v1/setup.py) egg_info for package proto-google-cloud-datastore-v1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
  Installing extra requirements: u'grpc'
Downloading/unpacking proto-google-cloud-logging-v2[grpc]>=0.91.3,<0.92dev (from gapic-google-cloud-logging-v2>=0.91.0,<0.92dev->google-cloud-logging>=1.2.0,<1.3dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading proto-google-cloud-logging-v2-0.91.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/proto-google-cloud-logging-v2/setup.py) egg_info for package proto-google-cloud-logging-v2
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
  Installing extra requirements: u'grpc'
Downloading/unpacking proto-google-cloud-spanner-v1[grpc]>=0.15.3,<0.16dev (from gapic-google-cloud-spanner-v1>=0.15.0,<0.16dev->google-cloud-spanner>=0.26.0,<0.27dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading proto-google-cloud-spanner-v1-0.15.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/proto-google-cloud-spanner-v1/setup.py) egg_info for package proto-google-cloud-spanner-v1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
  Installing extra requirements: u'grpc'
Downloading/unpacking proto-google-cloud-spanner-admin-database-v1[grpc]>=0.15.3,<0.16dev (from gapic-google-cloud-spanner-admin-database-v1>=0.15.0,<0.16dev->google-cloud-spanner>=0.26.0,<0.27dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading proto-google-cloud-spanner-admin-database-v1-0.15.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/proto-google-cloud-spanner-admin-database-v1/setup.py) egg_info for package proto-google-cloud-spanner-admin-database-v1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
  Installing extra requirements: u'grpc'
Downloading/unpacking proto-google-cloud-spanner-admin-instance-v1[grpc]>=0.15.3,<0.16dev (from gapic-google-cloud-spanner-admin-instance-v1>=0.15.0,<0.16dev->google-cloud-spanner>=0.26.0,<0.27dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading proto-google-cloud-spanner-admin-instance-v1-0.15.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/proto-google-cloud-spanner-admin-instance-v1/setup.py) egg_info for package proto-google-cloud-spanner-admin-instance-v1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
  Installing extra requirements: u'grpc'
Downloading/unpacking proto-google-cloud-error-reporting-v1beta1[grpc]>=0.15.3,<0.16dev (from gapic-google-cloud-error-reporting-v1beta1>=0.15.0,<0.16dev->google-cloud-error-reporting>=0.26.0,<0.27dev->google-cloud==0.27.0->uplynkcore==171010.246->-r /tmp/requirements.txt (line 56))
  Downloading proto-google-cloud-error-reporting-v1beta1-0.15.3.tar.gz
  Running setup.py (path:/tmp/pip_build_root/proto-google-cloud-error-reporting-v1beta1/setup.py) egg_info for package proto-google-cloud-error-reporting-v1beta1
    
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution

ERROR

    building 'gevent._semaphore' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/gevent/gevent._semaphore.c -o build/temp.linux-x86_64-2.7/src/gevent/gevent._semaphore.o
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/gevent/gevent._semaphore.o -o build/lib.linux-x86_64-2.7/gevent/_semaphore.so
      File "/usr/local/lib/python2.7/dist-packages/gevent/_socket3.py", line 195
        def makefile(self, mode="r", buffering=None, *,
                                                      ^
    SyntaxError: invalid syntax
    
  Running setup.py install for gipc
    
  Running setup.py install for ftputil
    Error processing line 3 of /usr/local/lib/python2.7/dist-packages/google_cloud_storage-1.1.1-py3.6-nspkg.pth:
    
      Traceback (most recent call last):
        File "/usr/lib/python2.7/site.py", line 158, in addpackage
          exec line
        File "<string>", line 1, in <module>
      KeyError: 'google'
    
    Remainder of file ignored
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 12, in <module>
        from setuptools.extension import Extension
      File "/usr/lib/python2.7/dist-packages/setuptools/extension.py", line 7, in <module>
        from setuptools.dist import _get_unpatched
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 16, in <module>
        import pkg_resources
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2760, in <module>
        add_activation_listener(lambda dist: dist.activate())
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 738, in subscribe
        callback(dist)
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2760, in <lambda>
        add_activation_listener(lambda dist: dist.activate())
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2316, in activate
        declare_namespace(pkg)
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1906, in declare_namespace
        declare_namespace(parent)
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1922, in declare_namespace
        _handle_ns(packageName, path_item)
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1889, in _handle_ns
        loader.load_module(packageName)
      File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
        mod = imp.load_module(fullname, self.file, self.filename, self.etc)
      File "/usr/local/lib/python2.7/dist-packages/google/__init__.py", line 52, in <module>
        from BeautifulSoup import BeautifulSoup
    ImportError: No module named BeautifulSoup
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/ftputil/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-RaijE7-record/install-record.txt --single-version-externally-managed --compile:
    Error processing line 3 of /usr/local/lib/python2.7/dist-packages/google_cloud_storage-1.1.1-py3.6-nspkg.pth:



  Traceback (most recent call last):

    File "/usr/lib/python2.7/site.py", line 158, in addpackage

      exec line

    File "<string>", line 1, in <module>

  KeyError: 'google'



Remainder of file ignored

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 12, in <module>

    from setuptools.extension import Extension

  File "/usr/lib/python2.7/dist-packages/setuptools/extension.py", line 7, in <module>

    from setuptools.dist import _get_unpatched

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 16, in <module>

    import pkg_resources

  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2760, in <module>

    add_activation_listener(lambda dist: dist.activate())

  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 738, in subscribe

    callback(dist)

  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2760, in <lambda>

    add_activation_listener(lambda dist: dist.activate())

  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2316, in activate

    declare_namespace(pkg)

  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1906, in declare_namespace

    declare_namespace(parent)

  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1922, in declare_namespace

    _handle_ns(packageName, path_item)

  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1889, in _handle_ns

    loader.load_module(packageName)

  File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module

    mod = imp.load_module(fullname, self.file, self.filename, self.etc)

  File "/usr/local/lib/python2.7/dist-packages/google/__init__.py", line 52, in <module>

    from BeautifulSoup import BeautifulSoup

ImportError: No module named BeautifulSoup

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/ftputil/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-RaijE7-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/ftputil
Storing debug log for failure in /root/.pip/pip.log
@zafields zafields changed the title Cannot install google==1.9.3 alongside other "google-*" tools via pip install -r ./requirements.txt Cannot install google==1.9.3 alongside other "google-*" libs via pip install -r ./requirements.txt Nov 4, 2017
@zafields
Copy link
Author

zafields commented Nov 4, 2017

My current workaround is to run pip install google on a subsequent Dockerfile RUN instruction. However, it should be noted, this is not an acceptable final solution for my project.

@theacodes
Copy link
Contributor

please note that the google package on PyPI is not owned by Google. I'm going to try to reach out to the author to see if he can rename it to something else, as this is extremely problematic for us.

@theacodes theacodes self-assigned this Nov 4, 2017
@chemelnucfin chemelnucfin changed the title Cannot install google==1.9.3 alongside other "google-*" libs via pip install -r ./requirements.txt Packaging: Cannot install google==1.9.3 alongside other "google-*" libs via pip install -r ./requirements.txt Nov 4, 2017
@tseaver tseaver added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Nov 6, 2017
@zafields
Copy link
Author

zafields commented Nov 7, 2017

When I worked at Microsoft, Ubuntu was willing to transfer ownership of any snap packages where a third-party had attempted to reserve one of our licensed names. Perhaps if you reach out to https://pypi.python.org/pypi they will just add the name to your account.

@dhermes
Copy link
Contributor

dhermes commented Nov 7, 2017

Luckily @jonparrott already is a member of PyPA (the "packaging authority") so hopefully he has the required visibility.

@theacodes
Copy link
Contributor

theacodes commented Nov 7, 2017 via email

@chemelnucfin chemelnucfin added the type: process A process-related concern. May include testing, release, or the like. label Jan 9, 2018
@theacodes
Copy link
Contributor

The maintainer of google has updated it to 2.0.0 and the import package is now googlesearch. Closing this issue.

@dhermes
Copy link
Contributor

dhermes commented Jan 10, 2018

Awesome news @jonparrott thanks for persisting on that!

@theacodes
Copy link
Contributor

Thank @MarioVilas, who was more than amenable to the change. :)

@ghost
Copy link

ghost commented Sep 22, 2018

googlesearch has no support for python 3

@MarioVilas
Copy link

googlesearch has no support for python 3

What makes you say that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging priority: p2 Moderately-important priority. Fix may not be included in next release. type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

No branches or pull requests

6 participants