cbrnr / sleepecg

Sleep stage detection using ECG
BSD 3-Clause "New" or "Revised" License
93 stars 25 forks source link

Conflicting requirements for `pip install "sleepecg[full]"` #176

Closed cbrnr closed 1 year ago

cbrnr commented 1 year ago

At least on macOS ARM64 (I'll test other platforms later), pip install "sleepecg[full]" installs an old version (0.4.1) of sleepecg. I'm not quite sure yet where the problem is (probably numba or tensorflow in combination with numpy), but we seem to have conflicting requirements somewhere.

Interestingly, when I first pip install tensorflow and then pip install "sleepecg[full]", everything works just fine (the latest sleepecg version 0.5.4 gets installed). Could it be an issue with pip? 🤔

Here's the full output for pip install "sleepecg[full]" in a fresh env:

``` ❯ pip install "sleepecg[full]" Collecting sleepecg[full] Downloading sleepecg-0.5.4-cp310-cp310-macosx_11_0_arm64.whl (2.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 5.9 MB/s eta 0:00:00 Collecting numpy>=1.20.0 (from sleepecg[full]) Using cached numpy-1.24.3-cp310-cp310-macosx_11_0_arm64.whl (13.9 MB) Collecting PyYAML>=5.4.0 (from sleepecg[full]) Using cached PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl (173 kB) Collecting requests>=2.25.0 (from sleepecg[full]) Using cached requests-2.31.0-py3-none-any.whl (62 kB) Collecting scipy>=1.7.0 (from sleepecg[full]) Using cached scipy-1.10.1-cp310-cp310-macosx_12_0_arm64.whl (28.8 MB) Collecting tqdm>=4.60.0 (from sleepecg[full]) Using cached tqdm-4.65.0-py3-none-any.whl (77 kB) Collecting joblib>=1.0.0 (from sleepecg[full]) Using cached joblib-1.2.0-py3-none-any.whl (297 kB) Collecting matplotlib>=3.5.0 (from sleepecg[full]) Using cached matplotlib-3.7.1-cp310-cp310-macosx_11_0_arm64.whl (7.3 MB) Collecting mne>=1.0.0 (from sleepecg[full]) Using cached mne-1.4.0-py3-none-any.whl (7.7 MB) Collecting wfdb>=3.4.0 (from sleepecg[full]) Using cached wfdb-4.1.1-py3-none-any.whl (159 kB) Collecting numba>=0.55.0 (from sleepecg[full]) Using cached numba-0.57.0-cp310-cp310-macosx_11_0_arm64.whl (2.5 MB) INFO: pip is looking at multiple versions of sleepecg[full] to determine which version is compatible with other requirements. This could take a while. Collecting sleepecg[full] Downloading sleepecg-0.5.3-cp310-cp310-macosx_11_0_arm64.whl (2.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 2.4 MB/s eta 0:00:00 Collecting pandas>=1.4.0 (from sleepecg[full]) Using cached pandas-2.0.1-cp310-cp310-macosx_11_0_arm64.whl (10.8 MB) Collecting sleepecg[full] Downloading sleepecg-0.5.2-cp310-cp310-macosx_11_0_arm64.whl (2.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 2.7 MB/s eta 0:00:00 Downloading sleepecg-0.5.1-cp310-cp310-macosx_11_0_arm64.whl (52 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 52.4/52.4 kB 5.2 MB/s eta 0:00:00 Downloading sleepecg-0.5.0-cp310-cp310-macosx_11_0_arm64.whl (51 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.9/51.9 kB 5.2 MB/s eta 0:00:00 Downloading sleepecg-0.4.1.tar.gz (40 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.6/40.6 kB 4.3 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting pyEDFlib>=0.1.22 (from sleepecg[full]) Using cached pyEDFlib-0.1.32-cp310-cp310-macosx_10_9_universal2.whl Collecting pooch>=1.5 (from mne>=1.0.0->sleepecg[full]) Using cached pooch-1.7.0-py3-none-any.whl (60 kB) Collecting decorator (from mne>=1.0.0->sleepecg[full]) Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB) Collecting packaging (from mne>=1.0.0->sleepecg[full]) Using cached packaging-23.1-py3-none-any.whl (48 kB) Collecting jinja2 (from mne>=1.0.0->sleepecg[full]) Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB) Collecting llvmlite<0.41,>=0.40.0dev0 (from numba>=0.55.0->sleepecg[full]) Using cached llvmlite-0.40.0-cp310-cp310-macosx_11_0_arm64.whl (28.1 MB) Collecting python-dateutil>=2.8.2 (from pandas>=1.4.0->sleepecg[full]) Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB) Collecting pytz>=2020.1 (from pandas>=1.4.0->sleepecg[full]) Using cached pytz-2023.3-py2.py3-none-any.whl (502 kB) Collecting tzdata>=2022.1 (from pandas>=1.4.0->sleepecg[full]) Using cached tzdata-2023.3-py2.py3-none-any.whl (341 kB) Collecting charset-normalizer<4,>=2 (from requests>=2.25.0->sleepecg[full]) Using cached charset_normalizer-3.1.0-cp310-cp310-macosx_11_0_arm64.whl (123 kB) Collecting idna<4,>=2.5 (from requests>=2.25.0->sleepecg[full]) Using cached idna-3.4-py3-none-any.whl (61 kB) Collecting urllib3<3,>=1.21.1 (from requests>=2.25.0->sleepecg[full]) Using cached urllib3-2.0.2-py3-none-any.whl (123 kB) Collecting certifi>=2017.4.17 (from requests>=2.25.0->sleepecg[full]) Using cached certifi-2023.5.7-py3-none-any.whl (156 kB) Collecting SoundFile>=0.10.0 (from wfdb>=3.4.0->sleepecg[full]) Using cached soundfile-0.12.1-py2.py3-none-macosx_11_0_arm64.whl (1.1 MB) Collecting contourpy>=1.0.1 (from matplotlib>=3.5.0->sleepecg[full]) Using cached contourpy-1.0.7-cp310-cp310-macosx_11_0_arm64.whl (229 kB) Collecting cycler>=0.10 (from matplotlib>=3.5.0->sleepecg[full]) Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB) Collecting fonttools>=4.22.0 (from matplotlib>=3.5.0->sleepecg[full]) Using cached fonttools-4.39.4-py3-none-any.whl (1.0 MB) Collecting kiwisolver>=1.0.1 (from matplotlib>=3.5.0->sleepecg[full]) Using cached kiwisolver-1.4.4-cp310-cp310-macosx_11_0_arm64.whl (63 kB) Collecting pillow>=6.2.0 (from matplotlib>=3.5.0->sleepecg[full]) Using cached Pillow-9.5.0-cp310-cp310-macosx_11_0_arm64.whl (3.1 MB) Collecting pyparsing>=2.3.1 (from matplotlib>=3.5.0->sleepecg[full]) Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB) Collecting platformdirs>=2.5.0 (from pooch>=1.5->mne>=1.0.0->sleepecg[full]) Using cached platformdirs-3.5.1-py3-none-any.whl (15 kB) Collecting six>=1.5 (from python-dateutil>=2.8.2->pandas>=1.4.0->sleepecg[full]) Using cached six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting cffi>=1.0 (from SoundFile>=0.10.0->wfdb>=3.4.0->sleepecg[full]) Using cached cffi-1.15.1-cp310-cp310-macosx_11_0_arm64.whl (174 kB) Collecting MarkupSafe>=2.0 (from jinja2->mne>=1.0.0->sleepecg[full]) Using cached MarkupSafe-2.1.2-cp310-cp310-macosx_10_9_universal2.whl (17 kB) Collecting pycparser (from cffi>=1.0->SoundFile>=0.10.0->wfdb>=3.4.0->sleepecg[full]) Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB) Building wheels for collected packages: sleepecg Building wheel for sleepecg (pyproject.toml) ... done Created wheel for sleepecg: filename=sleepecg-0.4.1-cp310-cp310-macosx_10_9_universal2.whl size=47468 sha256=887dd9ff834a97235b9ae5114f5440b8c05640ed2035466567fa3d8d196c30fe Stored in directory: /Users/clemens/Library/Caches/pip/wheels/d7/be/c2/26eabe1023f1d0218bbc4edd1eabbaf4f6a20127abd51b24d2 Successfully built sleepecg Installing collected packages: pytz, urllib3, tzdata, tqdm, six, PyYAML, pyparsing, pycparser, platformdirs, pillow, packaging, numpy, MarkupSafe, llvmlite, kiwisolver, joblib, idna, fonttools, decorator, cycler, charset-normalizer, certifi, scipy, requests, python-dateutil, pyEDFlib, numba, jinja2, contourpy, cffi, SoundFile, sleepecg, pooch, pandas, matplotlib, wfdb, mne Successfully installed MarkupSafe-2.1.2 PyYAML-6.0 SoundFile-0.12.1 certifi-2023.5.7 cffi-1.15.1 charset-normalizer-3.1.0 contourpy-1.0.7 cycler-0.11.0 decorator-5.1.1 fonttools-4.39.4 idna-3.4 jinja2-3.1.2 joblib-1.2.0 kiwisolver-1.4.4 llvmlite-0.40.0 matplotlib-3.7.1 mne-1.4.0 numba-0.57.0 numpy-1.24.3 packaging-23.1 pandas-2.0.1 pillow-9.5.0 platformdirs-3.5.1 pooch-1.7.0 pyEDFlib-0.1.32 pycparser-2.21 pyparsing-3.0.9 python-dateutil-2.8.2 pytz-2023.3 requests-2.31.0 scipy-1.10.1 six-1.16.0 sleepecg-0.4.1 tqdm-4.65.0 tzdata-2023.3 urllib3-2.0.2 wfdb-4.1.1 ```
cbrnr commented 1 year ago

It looks like the reason for this behavior is that tensorflow is currently only available as a pre-release (2.13.0rc0) for macOS ARM64. Until then, the following workaround can be used:

pip install tensorflow
pip install "sleepecg[full]"

The first command installs the pre-release, because it is the only available version (pip does this even without the --pre flag).