AllenInstitute/ipfx

can't install ipfx

sayakaminegishi opened this issue · 3 comments

Describe the bug
I tried to install ipfx by creating a conda environment and using pip install, but the python code I am trying to run still says "no module named 'ipfx'" and I cannot run code in my python program, such as "from ipfx.feature_extractor import (SpikeFeatureExtractor,SpikeTrainFeatureExtractor)"

It would be truly appreciated if you could help me fix this issue.
Thank you so much.

To Reproduce
(base) sayakaminegishi@Sayakas-MacBook-Pro ~ %conda create -n myenv python=3.6
(base) sayakaminegishi@Sayakas-MacBook-Pro ~ % conda activate myenv
(myenv) sayakaminegishi@Sayakas-MacBook-Pro ~ % pip install ipfx

Expected behavior
What you expected to happen.
be able to import ipfx in my python program.

Actual Behavior
unable to use/import ipfx. python console output gave "ModuleNotFoundError: No module named 'ipfx'"

Environment (please complete the following information):

  • OS & version: mac os
  • Python version 3.6?
  • AllenSDK version ?

Additional context
Add any other context about the problem here.

Do you want to work on this issue?
Are you willing and able to fix this bug? If so, let us know here (and see the guide). Thank you!

I also have problems installing on a M1 MacBook Pro using pip, with python version 3.9.18 and setuptools version 69.0.2, and cloning the master branch and run setup.py also no use. The error message for pip:

Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [54 lines of output]
Running from numpy source directory.
:461: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
/private/var/folders/m2/syn15js158z7z32g0s_9dm1r0000gn/T/pip-install-z_806v96/numpy_44d7bb6586e04f3fb237f9725728b700/tools/cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
required_version = LooseVersion('0.29.14')
/private/var/folders/m2/syn15js158z7z32g0s_9dm1r0000gn/T/pip-install-z_806v96/numpy_44d7bb6586e04f3fb237f9725728b700/tools/cythonize.py:77: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cython_version) < required_version:

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
              self.rng_state.ctr.v[i] = counter[i]
  
          self._reset_state_variables()
  
          self._bitgen.state = <void *>&self.rng_state
          self._bitgen.next_uint64 = &philox_uint64
                                     ^
  ------------------------------------------------------------
  
  _philox.pyx:195:35: Cannot assign type 'uint64_t (*)(void *) except? -1 nogil' to 'uint64_t (*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'uint64_t (void *) except? -1 nogil'.
  Processing numpy/random/_bounded_integers.pxd.in
  Processing numpy/random/_philox.pyx
  Traceback (most recent call last):
    File "/private/var/folders/m2/syn15js158z7z32g0s_9dm1r0000gn/T/pip-install-z_806v96/numpy_44d7bb6586e04f3fb237f9725728b700/tools/cythonize.py", line 238, in <module>
      main()
    File "/private/var/folders/m2/syn15js158z7z32g0s_9dm1r0000gn/T/pip-install-z_806v96/numpy_44d7bb6586e04f3fb237f9725728b700/tools/cythonize.py", line 234, in main
      find_process_files(root_dir)
    File "/private/var/folders/m2/syn15js158z7z32g0s_9dm1r0000gn/T/pip-install-z_806v96/numpy_44d7bb6586e04f3fb237f9725728b700/tools/cythonize.py", line 225, in find_process_files
      process(root_dir, fromfile, tofile, function, hash_db)
    File "/private/var/folders/m2/syn15js158z7z32g0s_9dm1r0000gn/T/pip-install-z_806v96/numpy_44d7bb6586e04f3fb237f9725728b700/tools/cythonize.py", line 191, in process
      processor_function(fromfile, tofile)
    File "/private/var/folders/m2/syn15js158z7z32g0s_9dm1r0000gn/T/pip-install-z_806v96/numpy_44d7bb6586e04f3fb237f9725728b700/tools/cythonize.py", line 80, in process_pyx
      subprocess.check_call(
    File "/opt/anaconda3/envs/python_3_9_ipfx/lib/python3.9/subprocess.py", line 373, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/opt/anaconda3/envs/python_3_9_ipfx/bin/python', '-m', 'cython', '-3', '--fast-fail', '-o', '_philox.c', '_philox.pyx']' returned non-zero exit status 1.
  Cythonizing sources
  Traceback (most recent call last):
    File "/opt/anaconda3/envs/python_3_9_ipfx/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/opt/anaconda3/envs/python_3_9_ipfx/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/opt/anaconda3/envs/python_3_9_ipfx/lib/python3.9/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 "/private/var/folders/m2/syn15js158z7z32g0s_9dm1r0000gn/T/pip-build-env-vwlvbkpo/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 366, in prepare_metadata_for_build_wheel
      self.run_setup()
    File "/private/var/folders/m2/syn15js158z7z32g0s_9dm1r0000gn/T/pip-build-env-vwlvbkpo/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 480, in run_setup
      super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
    File "/private/var/folders/m2/syn15js158z7z32g0s_9dm1r0000gn/T/pip-build-env-vwlvbkpo/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 488, in <module>
    File "<string>", line 469, in setup_package
    File "<string>", line 275, in generate_cython
  RuntimeError: Running cythonize failed!
  [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.

@VeritatemAmo Could you try cloning #559 and updating the issue if it works or doesn't work for you? It might resolve the issue you have with installation.

The PR to update IPFX Python version support and update most dependencies has been merged. This should resolve the installation issues you're facing. If you still run into probems please open a new issue with details.