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

Issues with api-book/requirements.txt #51

Open
wimdavies opened this issue Oct 18, 2023 · 2 comments
Open

Issues with api-book/requirements.txt #51

wimdavies opened this issue Oct 18, 2023 · 2 comments

Comments

@wimdavies
Copy link
Contributor

wimdavies commented Oct 18, 2023

Hi there,

My OS: Ubuntu 22.04 LTS, using WSL2 on a machine running Windows 10 version 22H2
Python version 3.10

I recently followed the boilerplate instructions in api-book/README.md for building the api-book notebook, and came across three issues with requirements.txt.

Issue 1
In a fresh virtual environment created with python3 -m venv, I ran pip install -r requirements.txt.
I received the following errors:

ERROR: Could not find a version that satisfies the requirement pkg-resources==0.0.0
ERROR: No matching distribution found for pkg-resources==0.0.0

This appears to arise from an underlying issue with Ubuntu/Debian metadata handling when running pip freeze.
The pip install issue can be resolved by removing the line pkg-resources==0.0.0 from requirements.txt.
Please see:
https://stackoverflow.com/questions/39577984/what-is-pkg-resources-0-0-0-in-output-of-pip-freeze-command
https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871790
pypa/pip#4022

Issue 2:
Re-running pip install -r requirements.txt failed, due to deprecated setup.cfg in [email protected]. This causes a compatibility issue with Python versions >= 3.10..
Please see:
yaml/pyyaml#724
kubeflow/pipelines#9949
I was able to resolve this issue by setting PyYAML>=5.4.1 in requirements.txt.

Issue 3:
Re-running pip install -r requirements.txt failed again, because [email protected] not compatible with Python 3.10. According to oldest-supported-numpy, version 1.21.6 onwards is compatible. However, for Cython 3.0.x support (which apparently is the cause of additional recent failures, in Python versions >= 3.10), you need numpy 1.26.x.
Please see:
pandas-dev/pandas#50945
https://github.com/scipy/oldest-supported-numpy/blob/b0b3376f6838abd91a9988b936f70939d4acb775/setup.cfg#L65
I was able to resolve this issue by setting numpy>=1.19.5 in requirements.txt.

After making the above edits to requirements.txt, I was able to run pip install and build the Jupyter notebook.
I'd be happy to open a PR reflecting these changes, if that would be useful?

edit: I've opened PR #52

@atiro
Copy link
Contributor

atiro commented Nov 27, 2023

Ah thank you @wimdavies , haven't re-run a build of the docs in ages. Will take a look this week if I can and pull in your PR

@wimdavies
Copy link
Contributor Author

Thanks @atiro! I hope it's helpful.

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

No branches or pull requests

2 participants