Install fails on Python 3.13
getting this error why I try to install on python 3.13.0
Due to a breaking change in the pandas API that caused bugs in nfl_data_py, the latest release is intentionally constrained to numpy < 2.0 (See https://github.com/nflverse/nfl_data_py/issues/98#issuecomment-2344408893). numpy v1 was maintained only up to Python 3.12, so unfortunately that is the expected result when attempting to install on Python 3.13.
Good news! nfl_data_py v1.0 will be released in a few weeks, which will include support for numpy v2.
Here are some workaround options in the meantime:
-
(recommended) Use Python 3.12 in a virtual environment. If you haven't used a virtual environment tool before, I recommend conda or pipenv. Learning to use one takes a bit of patience, but it will make your dev life SO much easier in the long run. I'm happy to help if you have questions getting started.
-
(if new to Python) Don't want to use a virtual environment and don't mind resetting your system's local Python config? You can downgrade your base Python installation.
-
If you are fluent with Docker, you can use the
python:3.12image as a super-isolated virtual environment. -
If you really have a reason you need to use Python 3.13 right now, you can do so by installing the previous version of nfl_data_py that did not include the numpy version constraint. Go this route at your own risk; you will lose the bug fixes described in the 0.3.3 release notes and also possibly encounter weird issues like in #45.
Wound out downgrading to 3.12, but interested to see if the new version will be accepted soon. Awesome project guys, I cannot even begin to describe how cool it is!
Any update on when the version compatible with python 3.13 will be available ? Truly love you guys for the work you do
Love this library, looking forward to 1.0
Hey all, thanks for the comments! Life has been busy (what's new), but I wanted to at least let you know that this is still high on my todo list. I'm making a personal goal to release it before the NFL draft.
In the mean time, let me know if you have any issues with the workarounds I described above!
New to the world of Git etc. but really like this library so am trying to get it to work for me. Having an error on library dependencies so not able to get this one installed... Will be happy if user error (am new to this)!
Any guidance welcome.
Collecting nfl_data_py Downloading nfl_data_py-0.3.3-py3-none-any.whl.metadata (12 kB) Requirement already satisfied: numpy<2.0,>=1.0 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.11/site-packages (from nfl_data_py) (1.26.4) Collecting pandas<2.0,>=1.0 (from nfl_data_py) Downloading pandas-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB) Requirement already satisfied: appdirs>1 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.11/site-packages (from nfl_data_py) (1.4.4) Collecting fastparquet>0.5 (from nfl_data_py) Downloading fastparquet-2024.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.2 kB) Collecting cramjam>=2.3 (from fastparquet>0.5->nfl_data_py) Downloading cramjam-2.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.9 kB) Requirement already satisfied: fsspec in /home/trusted-service-user/cluster-env/trident_env/lib/python3.11/site-packages (from fastparquet>0.5->nfl_data_py) (2024.3.1) Requirement already satisfied: packaging in /home/trusted-service-user/cluster-env/trident_env/lib/python3.11/site-packages (from fastparquet>0.5->nfl_data_py) (23.1) Requirement already satisfied: python-dateutil>=2.8.1 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.11/site-packages (from pandas<2.0,>=1.0->nfl_data_py) (2.8.2) Requirement already satisfied: pytz>=2020.1 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.11/site-packages (from pandas<2.0,>=1.0->nfl_data_py) (2023.3.post1) Requirement already satisfied: six>=1.5 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.11/site-packages (from python-dateutil>=2.8.1->pandas<2.0,>=1.0->nfl_data_py) (1.16.0) Downloading nfl_data_py-0.3.3-py3-none-any.whl (13 kB) Downloading fastparquet-2024.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 81.9 MB/s eta 0:00:00 Downloading pandas-1.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.0/12.0 MB 150.5 MB/s eta 0:00:00 Downloading cramjam-2.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 196.2 MB/s eta 0:00:00 Installing collected packages: cramjam, pandas, fastparquet, nfl_data_py Attempting uninstall: pandas Found existing installation: pandas 2.1.4 Uninstalling pandas-2.1.4: Successfully uninstalled pandas-2.1.4 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. salib 1.5.0 requires pandas>=2.0, but you have pandas 1.5.3 which is incompatible. Successfully installed cramjam-2.9.1 fastparquet-2024.11.0 nfl_data_py-0.3.3 pandas-1.5.3
@infomod That error is due to an incompatibility between the versions of pandas required by nfl_data_py and the version of SALib you have already installed on your system (see the 2nd-to-last line of that printout).
Assuming your application doesn't currently need SALib 1.5 features, the quick fix is to install the previous version which doesn't require pandas 2.0.
pip install "salib<1.5"
I don't know if this is a related error, but I'm getting the below message when I try to execute the below code. I've tried different versions of pandas and numpy but I'm still getting the same result. Any help would be very appreciated!
Code: !pip install nfl_data_py import nfl_data_py as nfl
Message :numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
@seh363 that error happens when your pandas version is correct, but your numpy installation is still v2.0+. Run the following to ensure you have the correct version of all dependencies.
pip install --force-reinstall nfl_data_py
Commenting here so I remember to check back later. Looking forward to 1.0! Thanks for making this package
draft
Hey my friend. I really appreciate your work and wanted to say thank you.
Any news on the release of the 1.0 version?
Thanks in advance.
@alecglen - saw you merged a few PRs last week, any update to share on when we're aiming to release 1.0 and a fix for this?
I don't mind using 3.12 for now..just curious.
Hey all, thanks for your patience. I am actively working on it and will give a meaningful update soon!
Hey - Any update on an ETA for the fixes to support 3.13? Absolutely love this library
Having issues since yesterday with either version of the below code. Both get stuck on "Building wheels for collected packages: pandas" and just continue to run forever. Any help would be appreciated!
!pip install --force-reinstall nfl_data_py import nfl_data_py as nfl
!pip install nfl_data_py import nfl_data_py as nfl
@seh363 - give my branch a try: https://github.com/nflverse/nfl_data_py/pull/134
edit: adding instructions here as well
pip install git+https://github.com/jbf302/nfl_data_py.git@feature/python-3.13-support
^^ should do the trick
Option 2: Clone and Install Manually If you prefer to clone the repository to your local machine first, follow these steps:
Clone the forked repository:
git clone https://github.com/jbf302/nfl_data_py.git
Navigate into the new directory:
cd nfl_data_py
Switch to the branch containing the fix:
git checkout feature/python-3.13-support
Install the package locally:
pip install .
After using either method, you can verify the installation by opening a Python interpreter and importing the library:
import nfl_data_py