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.0 has dropped support for Python 2, causing installation to fail due to unpinned numpy requirement #152

Closed
ghost opened this issue Jul 22, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 22, 2019

Not sure where you're at in terms of deciding to finally end support for Python 2, but I have been getting this issue since numpy released some prerelease versions of 1.17.0.

The root cause is really the unpinned dependency on numpy (which means it will just break for external reasons), but also the fact that it is installing RC versions of numpy in the first place. The only thing I can guess at this point is that the versions installed as a "setup requirement" are not correctly excluding RC versions and installing the latest production release.

Note that the 1.17.0 are flagged as prerelease on https://pypi.org/project/numpy/#history, so shouldn't be installed as a dependency of a production package, but for some reason they are.

It should be easy to replicate by simply trying to install cf-units into an empty Python 2 virtualenv, e.g.

$ virtualenv venv && source venv/bin/activate && pip install cf-units
New python executable in /tmp/venv/bin/python
Installing setuptools, pip, wheel...done.
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 cf-units
  Downloading https://files.pythonhosted.org/packages/43/45/c23e9412fbccf511de996bb6450ca8862e1273839617dd17240d9c179324/cf-units-2.1.1.tar.gz (174kB)
     |████████████████████████████████| 184kB 3.1MB/s 
    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-COYfrD/cf-units/setup.py", line 144, in <module>
        ext_modules=[udunits_ext]
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
        replace_conflicting=True,
      File "/tmp/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
        replace_conflicting=replace_conflicting
      File "/tmp/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/tmp/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
        return cmd.easy_install(req)
      File "/tmp/venv/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 "/tmp/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/tmp/venv/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 "/tmp/venv/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 "/tmp/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
        raise
      File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/tmp/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-vUF5hi/numpy-1.17.0rc2/setup.py", line 31, in <module>
        def finalize_options(self):
    RuntimeError: Python version >= 3.5 required.
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-COYfrD/cf-units/
@bjlittle
Copy link
Member

Not sure where you're at in terms of deciding to finally end support for Python 2, but I have been getting this issue since numpy released some prerelease versions of 1.17.0.

@lwgordonimos See https://github.com/SciTools/iris/milestones

We're aiming to make iris v3.0.0 Python3 only from Nov 5 2019, and this will apply to most of the major packages under SciTools, including cf-units 😄

HTH

@ghost
Copy link
Author

ghost commented Jul 24, 2019

Great, thanks for the clarification! 👍

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

1 participant