ghammad / pyActigraphy

Python-based open source package for actigraphy data analysis
https://ghammad.github.io/pyActigraphy
GNU General Public License v3.0
135 stars 25 forks source link

pyActigraphy: installation error #153

Open Nalu24 opened 1 month ago

Nalu24 commented 1 month ago

I try to install pyActigraphy but the system encounters an error while generating package metadata. Could you help me? Thanks a lot

Collecting pyActigraphy Using cached pyActigraphy-1.2.2-py3-none-any.whl.metadata (7.2 kB) Requirement already satisfied: joblib in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (1.4.2) Requirement already satisfied: lmfit in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (1.3.1) Requirement already satisfied: pandas in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (2.2.2) Requirement already satisfied: plotly in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (5.22.0) Requirement already satisfied: numba in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (0.60.0) Requirement already satisfied: numpy in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (1.26.4) Requirement already satisfied: pyexcel in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (0.7.0) Requirement already satisfied: pyexcel-ods3 in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (0.6.1) Requirement already satisfied: pyexcel-xlsx in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (0.6.0) Requirement already satisfied: scipy in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (1.14.0) Requirement already satisfied: spm1d in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (0.4.32) Requirement already satisfied: statsmodels>=0.10 in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (0.14.2) Requirement already satisfied: stochastic>=0.6.0 in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from pyActigraphy) (0.6.0) Collecting accelerometer>=6.2.2 (from pyActigraphy) Using cached accelerometer-6.2.3-py3-none-any.whl.metadata (5.1 kB) Requirement already satisfied: matplotlib in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from accelerometer>=6.2.2->pyActigraphy) (3.9.1) Requirement already satisfied: tqdm>=4.59.0 in c:\users\gaeta\appdata\local\programs\python\python312\lib\site-packages (from accelerometer>=6.2.2->pyActigraphy) (4.66.4) Collecting imbalanced-learn==0.8.1 (from accelerometer>=6.2.2->pyActigraphy) Using cached imbalanced_learn-0.8.1-py3-none-any.whl.metadata (12 kB) Collecting scikit-learn==1.0.1 (from accelerometer>=6.2.2->pyActigraphy) Using cached scikit-learn-1.0.1.tar.gz (6.6 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [19 lines of output] Partial import of sklearn during the build process. Traceback (most recent call last): File "C:\Users\gaeta\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in main() File "C:\Users\gaeta\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gaeta\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 149, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gaeta\AppData\Local\Temp\pip-build-env-tre2_ke4\overlay\Lib\site-packages\setuptools\build_meta.py", line 368, in prepare_metadata_for_build_wheel self.run_setup() File "C:\Users\gaeta\AppData\Local\Temp\pip-build-env-tre2_ke4\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\gaeta\AppData\Local\Temp\pip-build-env-tre2_ke4\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup exec(code, locals()) File "", line 319, in File "", line 311, in setup_package ModuleNotFoundError: No module named 'numpy.distutils' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

naja23 commented 1 month ago

I am getting the same error when I try to install pyActigraphy inside a conda virtual environment. I even tried to use the command pip install -U git+https://github.com/ghammad/pyActigraphy besides pip3 install pyActigraphy, but I invariably get the same output:

Collecting git+https://github.com/ghammad/pyActigraphy
  Cloning https://github.com/ghammad/pyActigraphy to /tmp/pip-req-build-z528cwur
  Running command git clone --filter=blob:none --quiet https://github.com/ghammad/pyActigraphy /tmp/pip-req-build-z528cwur
  Resolved https://github.com/ghammad/pyActigraphy to commit cce641bb09bd1ac1912aa5eb09894ed152844475
  Preparing metadata (setup.py) ... done
Collecting joblib (from pyActigraphy==1.2.2)
  Using cached joblib-1.4.2-py3-none-any.whl.metadata (5.4 kB)
Collecting lmfit (from pyActigraphy==1.2.2)
  Using cached lmfit-1.3.1-py3-none-any.whl.metadata (13 kB)
Collecting pandas (from pyActigraphy==1.2.2)
  Using cached pandas-2.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)
Collecting plotly (from pyActigraphy==1.2.2)
  Using cached plotly-5.22.0-py3-none-any.whl.metadata (7.1 kB)
Collecting numba (from pyActigraphy==1.2.2)
  Using cached numba-0.60.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.7 kB)
Requirement already satisfied: numpy in ./.conda/envs/actigraphy/lib/python3.12/site-packages (from pyActigraphy==1.2.2) (1.26.4)
Collecting pyexcel (from pyActigraphy==1.2.2)
  Using cached pyexcel-0.7.0-py2.py3-none-any.whl.metadata (59 kB)
Collecting pyexcel-ods3 (from pyActigraphy==1.2.2)
  Using cached pyexcel_ods3-0.6.1-py3-none-any.whl.metadata (16 kB)
Collecting pyexcel-xlsx (from pyActigraphy==1.2.2)
  Using cached pyexcel_xlsx-0.6.0-py2.py3-none-any.whl.metadata (16 kB)
Collecting scipy (from pyActigraphy==1.2.2)
  Using cached scipy-1.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
Collecting spm1d (from pyActigraphy==1.2.2)
  Using cached spm1d-0.4.32-py3-none-any.whl.metadata (698 bytes)
Collecting statsmodels>=0.10 (from pyActigraphy==1.2.2)
  Using cached statsmodels-0.14.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (9.2 kB)
Collecting stochastic>=0.6.0 (from pyActigraphy==1.2.2)
  Using cached stochastic-0.6.0-py3-none-any.whl.metadata (6.0 kB)
Collecting accelerometer>=6.2.2 (from pyActigraphy==1.2.2)
  Using cached accelerometer-6.2.3-py3-none-any.whl.metadata (5.1 kB)
Collecting matplotlib (from accelerometer>=6.2.2->pyActigraphy==1.2.2)
  Using cached matplotlib-3.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
Collecting tqdm>=4.59.0 (from accelerometer>=6.2.2->pyActigraphy==1.2.2)
  Using cached tqdm-4.66.4-py3-none-any.whl.metadata (57 kB)
Collecting imbalanced-learn==0.8.1 (from accelerometer>=6.2.2->pyActigraphy==1.2.2)
  Using cached imbalanced_learn-0.8.1-py3-none-any.whl.metadata (12 kB)
Collecting scikit-learn==1.0.1 (from accelerometer>=6.2.2->pyActigraphy==1.2.2)
  Using cached scikit-learn-1.0.1.tar.gz (6.6 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      Partial import of sklearn during the build process.
      Traceback (most recent call last):
        File "/mnt/scratch/home/daniel/.conda/envs/actigraphy/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/mnt/scratch/home/daniel/.conda/envs/actigraphy/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/mnt/scratch/home/daniel/.conda/envs/actigraphy/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-j8kbrh8k/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 368, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/tmp/pip-build-env-j8kbrh8k/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-j8kbrh8k/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 319, in <module>
        File "<string>", line 311, in setup_package
      ModuleNotFoundError: No module named 'numpy.distutils'
      [end of output]

I think this problem has to do with the fact that numpy.distutils is deprecated, and was removed from Python versions >= 3.12, as per documentation (https://numpy.org/doc/stable/reference/distutils.html). Fortunately, I was able to circumvent this issue by downgrading my Python installation to 3.10 inside a Conda environment.

Tony-555 commented 1 month ago

Hi, I had the same issue, i followed the solution suggested by @naja23 I hope i can analyses my GENEactive data with this package.