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

NumPY 1.17.0rc1 is available to Python 2.7 #13911

Closed
bashtage opened this issue Jul 4, 2019 · 23 comments
Closed

NumPY 1.17.0rc1 is available to Python 2.7 #13911

bashtage opened this issue Jul 4, 2019 · 23 comments

Comments

@bashtage
Copy link
Contributor

bashtage commented Jul 4, 2019

I'm not sure if this is a PyPI limitation where availability depends on the most recent release, but 1.17.0rc1 is being made available to Python 2.7.

This is from an Azure run of statsmodels:

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already up-to-date: pip in /opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages (19.1.1)
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting numpy>=1.11 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/20/2c/4d64f1cd4d2170b91d24ae45725de837bd40c34c9c04c94255c0f51c513d/numpy-1.16.4-cp27-cp27m-manylinux1_x86_64.whl (17.0MB)
Collecting scipy>=0.18 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/3c/b1/e01e231073c9d64b481a11f1c0045ce568032ca0375deb64aff1cdc33a05/scipy-1.2.2-cp27-cp27m-manylinux1_x86_64.whl (24.8MB)
Collecting pandas>=0.19 (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/b2/4c/b6f966ac91c5670ba4ef0b0b5613b5379e3c7abdfad4e7b89a87d73bae13/pandas-0.24.2.tar.gz (11.8MB)
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-MLGgcN/pandas/setup.py", line 746, in <module>
        **setuptools_kwargs)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/__init__.py", line 128, in setup
        _install_setup_requires(attrs)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/dist.py", line 513, in fetch_build_eggs
        replace_conflicting=True,
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/pkg_resources/__init__.py", line 774, in resolve
        replace_conflicting=replace_conflicting
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1057, in best_match
        return self.obtain(req, installer)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1069, in obtain
        return installer(requirement)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/dist.py", line 580, in fetch_build_egg
        return cmd.easy_install(req)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 699, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 884, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1152, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1138, in run_setup
        run_setup(setup_script, args)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
        raise
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-pdeLgl/numpy-1.17.0rc1/setup.py", line 31, in <module>
    
    RuntimeError: Python version >= 3.5 required.
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-MLGgcN/pandas/
@charris
Copy link
Member

charris commented Jul 4, 2019

That's interesting. Sounds like a PyPI problem, but maybe there is something more we need to configure.

@mattip
Copy link
Member

mattip commented Jul 4, 2019

What command is azure running to cause this? It seems something like pip install -r requirements.txt ? When I do that in a clean virutalenv, I get numpy1.16.4

git clone https://github.com/statsmodels/statsmodels
virtualenv /tmp/python2
source /tmp/python2/bin/activate
cd statsmodels
pip -v
# reports pip 19.1.1
pip install -r requirements.txt
# reports Successfully installed numpy-1.16.4 pandas-0.24.2 \
#     patsy-0.5.1 python-dateutil-2.8.0 pytz-2019.1 scipy-1.2.2 six-1.12.0

@bashtage
Copy link
Contributor Author

bashtage commented Jul 4, 2019

Same, but requirements has

numpy>=1.11
scipy>=0.18
pandas>=0.19
patsy>=0.4

@mattip
Copy link
Member

mattip commented Jul 4, 2019

Can you somehow figure out what versions of python/pip/??? are involved? Without a reproducible isolated environment this is going to be hard to track down

@bashtage
Copy link
Contributor Author

bashtage commented Jul 4, 2019

Python is 2.7. pip is latest since line above is python -m pip install --upgrade pip. Platform is Linux64

@TimDumol
Copy link

TimDumol commented Jul 5, 2019

Here's a Dockerfile to replicate:

FROM python:2
RUN pip install -U pip && pip install gensim==2.1

This is the output when building:

Collecting gensim==2.1
  Downloading https://files.pythonhosted.org/packages/0c/35/0e2dbd6ff005d021ab89bcb35baeeff19bf7a3f30f75f98820f1d2876b39/gensim-2.1.0.tar.gz (15.1MB)
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-Otd0kv/gensim/setup.py", line 294, in <module>
        include_package_data=True,
      File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
        replace_conflicting=replace_conflicting
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
        raise
      File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-HdZ5tS/numpy-1.17.0rc1/setup.py", line 31, in <module>
        class custom_build_ext(build_ext):
    RuntimeError: Python version >= 3.5 required.

@rgommers
Copy link
Member

rgommers commented Jul 5, 2019 via email

@TimDumol
Copy link

TimDumol commented Jul 5, 2019

That's unreleased code, on gensim 3.7.3 (latest released), it's always:

        'numpy >= 1.11.3'

Interestingly, installing gensim 3.7.3 seems to work, whereas installing gensim 2.1.0 doesn't, even though both have upper-bound-less numpy requirement strings.

@rgommers
Copy link
Member

rgommers commented Jul 5, 2019

Interestingly, installing gensim 3.7.3 seems to work, whereas installing gensim 2.1.0 doesn't, even though both have upper-bound-less numpy requirement strings.

Hmm, that definitely points to a pip or setuptools bug.

Would be good to get some clarity on this before the final 1.17.0 release (but I'm not volunteering, no time in the next week, sorry).

easy_install is the common culprit. could be something as easy as differing setuptools versions, that would be an easy workaround.

@mattip
Copy link
Member

mattip commented Jul 14, 2019

@bashtage could you update setuptools (or report the version in play when this fails)?

@bashtage
Copy link
Contributor Author

If I add an update to setuptools in addition to pip then it works correctly.

@mattip
Copy link
Member

mattip commented Jul 15, 2019

Closing. Please reopen if the issue is still not settled.

@mattip mattip closed this as completed Jul 15, 2019
@kayasmith106
Copy link

kayasmith106 commented Jul 15, 2019

I am still having an issue when I deploy to a Google App Engine Flex Environment.

Step #1: Collecting reverse-geocoder==1.5.1 (from -r requirements.txt (line 80))
Step #1: Downloading https://files.pythonhosted.org/packages/0b/0f/b7d5d4b36553731f11983e19e1813a1059ad0732c5162c01b3220c927d31/reverse_geocoder-1.5.1.tar.gz (2.2MB)
Step #1: Complete output from command python setup.py egg_info:
Step #1: Traceback (most recent call last):
Step #1: File "", line 1, in
Step #1: File "/tmp/pip-install-H0uuhQ/reverse-geocoder/setup.py", line 32, in
Step #1: long_description=read('README.txt'))
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/init.py", line 128, in setup
Step #1: _install_setup_requires(attrs)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/init.py", line 123, in _install_setup_requires
Step #1: dist.fetch_build_eggs(dist.setup_requires)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/dist.py", line 504, in fetch_build_eggs
Step #1: replace_conflicting=True,
Step #1: File "/env/local/lib/python2.7/site-packages/pkg_resources/init.py", line 774, in resolve
Step #1: replace_conflicting=replace_conflicting
Step #1: File "/env/local/lib/python2.7/site-packages/pkg_resources/init.py", line 1057, in best_match
Step #1: return self.obtain(req, installer)
Step #1: File "/env/local/lib/python2.7/site-packages/pkg_resources/init.py", line 1069, in obtain
Step #1: return installer(requirement)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/dist.py", line 571, in fetch_build_egg
Step #1: return cmd.easy_install(req)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
Step #1: return self.install_item(spec, dist.location, tmpdir, deps)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 699, in install_item
Step #1: dists = self.install_eggs(spec, download, tmpdir)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 884, in install_eggs
Step #1: return self.build_and_install(setup_script, setup_base)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1152, in build_and_install
Step #1: self.run_setup(setup_script, setup_base, args)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1138, in run_setup
Step #1: run_setup(setup_script, args)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
Step #1: raise
Step #1: File "/usr/lib/python2.7/contextlib.py", line 35, in exit
Step #1: self.gen.throw(type, value, traceback)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
Step #1: yield
Step #1: File "/usr/lib/python2.7/contextlib.py", line 35, in exit
Step #1: self.gen.throw(type, value, traceback)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
Step #1: saved_exc.resume()
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
Step #1: six.reraise(type, exc, self._tb)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
Step #1: yield saved
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
Step #1: yield
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
Step #1: _execfile(setup_script, ns)
Step #1: File "/env/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
Step #1: exec(code, globals, locals)
Step #1: File "/tmp/easy_install-N2uBli/numpy-1.17.0rc1/setup.py", line 31, in
Step #1: license='lgpl',
Step #1: RuntimeError: Python version >= 3.5 required.
Step #1:
Step #1: ----------------------------------------
Step #1: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-H0uuhQ/reverse-geocoder/
Step #1: You are using pip version 10.0.1, however version 19.1.1 is available.
Step #1: You should consider upgrading via the 'pip install --upgrade pip' command.
Step #1: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/cloud-builders/docker@sha256:6e0e30514f339998b9cf9e9aba71b5ad8592eb1bd24ddc123a6a4f3b86b819d9" failed: exit status 1
Step #1:


@bashtage
Copy link
Contributor Author

Have you upgraded pip and setuptools?

@kayasmith106
Copy link

@bashtage I don't believe you are able to upgrade setuptools or pip in Google App Engine Flex environment. I could be wrong though.

@bashtage
Copy link
Contributor Author

Can you pin numpy<=1.16?

@kayasmith106
Copy link

kayasmith106 commented Jul 15, 2019

I actually have the following in my requirements.txt:

numpy==1.16.1

This is actually installed previous to reverse-geocoder which has the following requirement:

install_requires=['numpy>=1.11.0', 'scipy>=0.17.1',]

So I am unsure why it even tries to pickup numpy-1.17.0rc1 in the first place.
Sorry if this issue is too specific, just seeing if you have any idea if this can be solved.

@neilgrewal
Copy link

I'm also seeing this issue when deploying to Pivotal Cloud Foundry. I can't update the python buildpacks and have numpy pinned to a lower verison in my requirements.txt but thats not being respected when installing pandas

@mattip
Copy link
Member

mattip commented Jul 16, 2019

You cannot update setuptools via pip install --user --upgrade setuptools or by specifying setuptools >=40.7.0 in your requirements.txt? What version of setuptools are you stuck with?

@kayasmith106
Copy link

kayasmith106 commented Jul 16, 2019

I am going to have to use a custom runtime for Google Cloud App Engine Flex Environment. I had set the following in my requirements:

setuptools==41.0.1

However still run into the same issue. A custom runtime seems to be the only viable option at this time.

https://cloud.google.com/appengine/docs/flexible/python/customizing-the-python-runtime

@TimDumol
Copy link

FWIW, the issue is still reproducible with latest setuptools (41.0.1) and pip (19.1.1):

FROM python:2
RUN pip install -U setuptools && pip install -U pip && pip install 'gensim==2.1'

produces:

docker build .
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM python:2
 ---> 37093962fbf5
Step 2/2 : RUN pip install -U setuptools && pip install -U pip && pip install 'gensim==2.1'
 ---> Running in 4fdba299c36b
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/site-packages (41.0.1)
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages (19.1.1)
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting gensim==2.1
  Downloading https://files.pythonhosted.org/packages/0c/35/0e2dbd6ff005d021ab89bcb35baeeff19bf7a3f30f75f98820f1d2876b39/gensim-2.1.0.tar.gz (15.1MB)
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-eWASJJ/gensim/setup.py", line 294, in <module>
        include_package_data=True,
      File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
        replace_conflicting=replace_conflicting
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
        raise
      File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-4IC4zN/numpy-1.17.0rc2/setup.py", line 31, in <module>
        class custom_build_ext(build_ext):
    RuntimeError: Python version >= 3.5 required.
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-eWASJJ/gensim/
The command '/bin/sh -c pip install -U setuptools && pip install -U pip && pip install 'gensim==2.1'' returned a non-zero code: 1

Yet somehow the same Dockerfile with gensim==3.7.3 (which also has no upper bound on its numpy dependency) also works.

@bashtage
Copy link
Contributor Author

We are installing numpy first, and then installing statsmodels. This seems to work on azure/python 2.7.

The relevant lines are:

      python -m pip install --upgrade pip setuptools
      pip install numpy
      pip install -r requirements.txt
      pip install -r requirements-dev.txt
      pip install pytest-xdist

The log is big, but the key bits are

##[section]Starting: Install dependencies
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.151.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/4428b233-9540-4f1b-af83-69d1c1c01a8f.sh
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already up-to-date: pip in /opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages (19.1.1)
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/ec/51/f45cea425fd5cb0b0380f5b0f048ebc1da5b417e48d304838c02d6288a1e/setuptools-41.0.1-py2.py3-none-any.whl (575kB)
Installing collected packages: setuptools
  Found existing installation: setuptools 39.0.1
    Uninstalling setuptools-39.0.1:
      Successfully uninstalled setuptools-39.0.1
Successfully installed setuptools-41.0.1
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting numpy
  Downloading https://files.pythonhosted.org/packages/20/2c/4d64f1cd4d2170b91d24ae45725de837bd40c34c9c04c94255c0f51c513d/numpy-1.16.4-cp27-cp27m-manylinux1_x86_64.whl (17.0MB)
Installing collected packages: numpy
Successfully installed numpy-1.16.4
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: numpy>=1.11 in /opt/hostedtoolcache/Python/2.7.15/x64/lib/python2.7/site-packages (from -r requirements.txt (line 1)) (1.16.4)
Collecting scipy>=0.18 (from -r requirements.txt (line 2))
...
##[section]Finishing: Install dependencies

@kayasmith106
Copy link

kayasmith106 commented Jul 16, 2019

I also solved my issue with Google App Engine Flex by creating a custom run time environment, so I would be able to actually update pip and setuptools.

Here is my Dockerfile if anyone is interested, I removed the pinned numpy and reverse-geocoder from my requirements and installed them with the below:

  FROM gcr.io/google-appengine/python

 # Create a virtualenv for dependencies. This isolates these packages from
 # system-level packages.
 # Use -p python3 or -p python3.7 to select python version. Default is version 2.
 RUN virtualenv /env

 # Setting these environment variables are the same as running
 # source /env/bin/activate.
 ENV VIRTUAL_ENV /env
 ENV PATH /env/bin:$PATH

 # Copy the application's requirements.txt and run pip to install all
 # dependencies into the virtualenv.
 ADD requirements.txt /app/requirements.txt
 RUN pip install --upgrade pip setuptools
 RUN pip install numpy==1.16.2
 RUN pip install -r /app/requirements.txt
 RUN pip install reverse-geocoder==1.5.1

 # Add the application source code.
 ADD . /app

 # Run a WSGI server to serve the application. gunicorn must be declared as
 # a dependency in requirements.txt.
 CMD gunicorn  -b :$PORT main:app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants