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

Unable to install python library tables on newly created python 2.7.18 in Anaconda 3 #12647

Open
1 task done
matx93 opened this issue Apr 23, 2024 · 14 comments
Open
1 task done
Labels
Python 2 only Python 2 specific type: support User Support

Comments

@matx93
Copy link

matx93 commented Apr 23, 2024

Description

Command pip install tables failed on environment python 2.7.18 created with Anaconda 3

ERROR: Could not find a version that satisfies the requirement oldest-supported-numpy (from versions: none)
ERROR: No matching distribution found for oldest-supported-numpy

Expected behavior

No response

pip version

20.3.4

Python version

2.7.18

OS

W10

How to Reproduce

Install py2.7 on Anaconda 3:
conda create -n py27 python=2.7

Install tables
pip install tables

Output

Full traceback:

pip install tables
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. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting tables
Using cached https://files.pythonhosted.org/packages/84/86/34604cfd8e79d23ffef7f1c0ab134ddb98da572d0fcb9cb4631d5b47f549/tables-3.5.2-cp27-cp27m-win_amd64.whl
Requirement already satisfied: numpy>=1.9.3 in c:\users*\appdata\local\anaconda3\envs\py27\lib\site-packages (from tables) (1.16.6)
Requirement already satisfied: six>=1.9.0 in c:\users*\appdata\roaming\python\python27\site-packages (from tables) (1.16.0)
Collecting numexpr>=2.6.2
Using cached https://files.pythonhosted.org/packages/76/b3/935d7a16f696ecfa8e06ce1153b1f54925a42904c245cebb15077762b965/numexpr-2.8.1.tar.gz
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users*\AppData\Local\anaconda3\envs\py27\python.exe' 'C:\Users*\AppData\Local\anaconda3\envs\py27\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'c:\users***\appdata\local\temp\pip-build-env-wacl5j\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel oldest-supported-numpy
cwd: None
Complete output (7 lines):
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. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting setuptools
Using cached https://files.pythonhosted.org/packages/e1/b7/182161210a13158cd3ccc41ee19aadef54496b74f2817cc147006ec932b4/setuptools-44.1.1-py2.py3-none-any.whl
Collecting wheel
Using cached https://files.pythonhosted.org/packages/27/d6/003e593296a85fd6ed616ed962795b2f87709c3eee2bca4f6d0fe55c6d00/wheel-0.37.1-py2.py3-none-any.whl
ERROR: Could not find a version that satisfies the requirement oldest-supported-numpy (from versions: none)
ERROR: No matching distribution found for oldest-supported-numpy

Code of Conduct

@matx93 matx93 added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Apr 23, 2024
@RonnyPfannschmidt
Copy link
Contributor

Python 2.7 is eol since years

Please try and python version under active maintenance

@matx93
Copy link
Author

matx93 commented Apr 23, 2024

Thanks but this is not helping unfortunately. Python 2.7.18 is still provided as standard installation in Anaconda 3. it is weird that this does not work

@pfmoore
Copy link
Member

pfmoore commented Apr 23, 2024

You'd need to take that up with Anaconda. Pip doesn't support Python 2.7 any more.

@matx93
Copy link
Author

matx93 commented Apr 23, 2024

Ha! Funny. I have opened this originally in conda but devs pointed to pip!
conda/conda#13830

@pfmoore is there perhaps an earlier version of pip that I could try?

@RonnyPfannschmidt
Copy link
Contributor

That version is already being used,

I suspect there simply is no python 2 version of the package you asked for

@matx93
Copy link
Author

matx93 commented Apr 23, 2024

I was using this package on py2.7 before I had to re-build a py2.7 environment.
I suspect the cause is either upgraded pip does not work with library tables or there is some issue with dependencies

@RonnyPfannschmidt
Copy link
Contributor

https://pypi.org/project/oldest-supported-numpy/0.1/#data

Even the oldest version of this is python 3 only

So again stop using python 2

If anaconda still has that as a default I consider it a absolutely failure on them

@RonnyPfannschmidt
Copy link
Contributor

What version of python is provided if you don't explicitly pick 2.7 as you do?

@matx93
Copy link
Author

matx93 commented Apr 23, 2024

Although I can pick py3, I have scripts in py2 that I would like to run, and tables is the library I would need.
I understand moving to py3 is a solution, but not the one I am looking for.

The key question is: why is now tables asking for oldest-supported-numpy? this was never a requirement as this library is not supported in py2

@RonnyPfannschmidt
Copy link
Contributor

@matx93 because there is no python2 wheel, so pip tries to build it, and the latest version of tables (python3.9+) does not support python2

python2 has been completely eol since the start of 2020 - if you still need something in python2 to work, its completely on you to correctly pin all of the severely outdated versions of the packages you need

@notatallshaw
Copy link
Member

Python 2.7.18 is still provided as standard installation in Anaconda 3. it is weird that this does not work

Just because a software is available to download and install does not mean it is supported. Anaconda has stopped supporting Python 2.7, Python Foundation has stopped supporting Python 2.7, PyPA has stopped supporting Python 2.7, RHEL still supports Python 2.7 for the next couple of months but you must pay for that support and they don't support using pip to install libraries.

It is still possible to use 2.7, but it means you need to support it yourself, so you need to figure out how to install old packages yourself or go to help forums and ask there.

I think the main issue you're having is pip is trying to resolve packages that are too new to install into Python 2.7. This is a common problem with old Python versions, and there are lots of reasons it can't be automatically solved.

But there are workarounds, I would recommend you do this:

  1. In a separate terminal create a separate conda environment with Python 3
  2. Install pypi-timemachine in that conda environment, and read it's documentation
  3. Run pypi-timemachine set to 2019-12-31 or earlier
  4. Use pip in your Python 2 environment and point it to pypi-timemachine following the documentation
  5. Optionally, you may also need to use the legacy resolver option for pip

By doing this you won't get any newer packages than what were available on 2019-12-31, which should in general resolve your this particular issue with continuing to use Python 2.7.

Hope this helps and good luck.

@ichard26
Copy link
Member

ichard26 commented Apr 23, 2024

tables 3.5.2 which is the last release with Python 2.7 wheels depends on numexpr >= 2.6.2. In your situation (by looking at the logs), pip selects numexpr 2.8.1 which declares a build-time dependency on oldest-supported-numpy. The build step is necessary as this numexpr release has no Python 2.7 wheels.

Anyway, it looks like you'll need to use older versions of these packages. At the bare minimum, numexpr 2.7.3 is the last version to ship with Python 2.7 wheels (which won't need oldest-supported-numpy)

@ichard26 ichard26 added type: support User Support Python 2 only Python 2 specific and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Apr 23, 2024
@matx93
Copy link
Author

matx93 commented Apr 23, 2024

tables 3.5.2 which is the last release with Python 2.7 wheels depends on numexpr >= 2.6.2. In your situation (by looking at the logs), pip selects numexpr 2.8.1 which declares a build-time dependency on oldest-supported-numpy. The build step is necessary as this numexpr release has no Python 2.7 wheels.

Anyway, it looks like you'll need to use older versions of these packages. At the bare minimum, numexpr 2.7.3 is the last version to ship with Python 2.7 wheels (which won't need oldest-supported-numpy)

This actually made the trick! Thank you so much!! @ichard26

@pfmoore
Copy link
Member

pfmoore commented Apr 23, 2024

Another approach which might have helped here (and might be of use to others hitting similar issues) is to use --only-binary :all:. This will stop pip from using anything but pre-built wheels. If everything you need still has some Python 2 compatible binary wheel available, then pip would probably be able to find them. And by not allowing builds from source, if you are missing binaries that matter, you'll get a slightly more understandable message ("could not find a version of foo that is compatible") in place of a complicated build error traceback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python 2 only Python 2 specific type: support User Support
Projects
None yet
Development

No branches or pull requests

5 participants