LAMDA-NJU / Deep-Forest

An Efficient, Scalable and Optimized Python Framework for Deep Forest (2021.2.1)
https://deep-forest.readthedocs.io
Other
911 stars 158 forks source link

Installation issues on Macbook Pro 2022 (Apple Silicon) and Ubuntu #133

Closed simonprovost closed 1 year ago

simonprovost commented 1 year ago

Dear Authors,

Issue:

I've been facing persistent installation issues with the Deep Forest package on my new Macbook Pro 2022 (Apple Silicon, M2, 13-inch) running the latest macOS Sonoma and on a stable Ubuntu version (cluster university version no physical machine like a laptop or PC). This is despite having successfully installed and used the library on an older non-Apple Silicon MacBook a year or two ago..

Steps Tried:

  1. Initially, I followed the recommendations from issue #6.
  2. Attempted direct installation via pip.
  3. Tried installing from the provided wheel files.
  4. Repeated the above steps on a stable version of Ubuntu.
  5. Switched between Python versions 3.10.x and 3.9.x.

Error Encountered:

The consistent error I encountered points to splitter.pyx of the Cython side. Here's the error for reference:


>python -m pip install --verbose -e ./

Using pip 23.2.1 from /Users/sgp28/miniforge3/envs/DFtest/lib/python3.9/site-packages/pip (python 3.9)
Obtaining file:///Users/sgp28/Desktop/Delivery/Ph.D./tmp/Deep-Forest
  Running command pip subprocess to install build dependencies
  Collecting setuptools<60.0
    Using cached setuptools-59.8.0-py3-none-any.whl (952 kB)
  Collecting wheel
    Obtaining dependency information for wheel from https://files.pythonhosted.org/packages/b8/8b/31273bf66016be6ad22bb7345c37ff350276cfd46e389a0c2ac5da9d9073/wheel-0.41.2-py3-none-any.whl.metadata
    Using cached wheel-0.41.2-py3-none-any.whl.metadata (2.2 kB)
  Collecting Cython>=0.28.5
    Obtaining dependency information for Cython>=0.28.5 from https://files.pythonhosted.org/packages/a5/70/11e973497f9f635654ef1fefffd0573f83813a65cd9221215f08192fb531/Cython-3.0.3-py2.py3-none-any.whl.metadata
    Using cached Cython-3.0.3-py2.py3-none-any.whl.metadata (3.2 kB)
  Collecting oldest-supported-numpy
    Obtaining dependency information for oldest-supported-numpy from https://files.pythonhosted.org/packages/94/9a/756fef9346e5ca2289cb70d73990b4c9f25446a885c1186cfb93a85e7da0/oldest_supported_numpy-2023.8.3-py3-none-any.whl.metadata
    Using cached oldest_supported_numpy-2023.8.3-py3-none-any.whl.metadata (9.5 kB)
  Collecting scipy>=1.3.2
    Obtaining dependency information for scipy>=1.3.2 from https://files.pythonhosted.org/packages/6f/d9/d10111b008fabab4aea0f98274d3f5db4bd33baadf30c782b6e659ec7708/scipy-1.11.3-cp39-cp39-macosx_12_0_arm64.whl.metadata
    Downloading scipy-1.11.3-cp39-cp39-macosx_12_0_arm64.whl.metadata (60 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.4/60.4 kB 5.3 MB/s eta 0:00:00
  Collecting numpy==1.21.0 (from oldest-supported-numpy)
    Downloading numpy-1.21.0-cp39-cp39-macosx_11_0_arm64.whl (12.1 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.1/12.1 MB 106.4 MB/s eta 0:00:00
  INFO: pip is looking at multiple versions of scipy to determine which version is compatible with other requirements. This could take a while.
  Collecting scipy>=1.3.2
    Obtaining dependency information for scipy>=1.3.2 from https://files.pythonhosted.org/packages/77/31/b063f21370c6050a663aae5a9868d2fe112b21caeface3c248016dfea092/scipy-1.11.2-cp39-cp39-macosx_12_0_arm64.whl.metadata
    Downloading scipy-1.11.2-cp39-cp39-macosx_12_0_arm64.whl.metadata (54 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.1/54.1 kB 12.3 MB/s eta 0:00:00
    Obtaining dependency information for scipy>=1.3.2 from https://files.pythonhosted.org/packages/d8/97/3a15209262cf523dab38de372ff814f8fb7815f98ccc07c7996e77910612/scipy-1.11.1-cp39-cp39-macosx_12_0_arm64.whl.metadata
    Using cached scipy-1.11.1-cp39-cp39-macosx_12_0_arm64.whl.metadata (54 kB)
    Using cached scipy-1.10.1-cp39-cp39-macosx_12_0_arm64.whl (28.9 MB)
  Using cached wheel-0.41.2-py3-none-any.whl (64 kB)
  Using cached Cython-3.0.3-py2.py3-none-any.whl (1.2 MB)
  Using cached oldest_supported_numpy-2023.8.3-py3-none-any.whl (4.8 kB)
  Installing collected packages: wheel, setuptools, numpy, Cython, scipy, oldest-supported-numpy
  Successfully installed Cython-3.0.3 numpy-1.21.0 oldest-supported-numpy-2023.8.3 scipy-1.10.1 setuptools-59.8.0 wheel-0.41.2
  Installing build dependencies ... done
  Running command Checking if build backend supports build_editable
  Checking if build backend supports build_editable ... done
  Running command Getting requirements to build wheel
  Getting requirements to build wheel ... done
  Running command Preparing metadata (pyproject.toml)
  /private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /Users/sgp28/Desktop/Delivery/Ph.D./tmp/Deep-Forest/deepforest/tree/_splitter.pxd
    tree = Parsing.p_module(s, pxd, full_module_name)
  warning: deepforest/tree/_splitter.pxd:77:72: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_splitter.pxd:82:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_criterion.pxd:49:45: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_criterion.pxd:50:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_criterion.pxd:51:48: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_criterion.pxd:52:57: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_tree.pxd:46:78: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_tree.pxd:48:76: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_tree.pxd:50:58: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_tree.pxd:51:77: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_tree.pxd:52:74: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_splitter.pyx:172:72: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_splitter.pyx:202:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_splitter.pyx:269:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_splitter.pyx:585:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_splitter.pyx:1103:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_splitter.pyx:1332:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_utils.pxd:40:75: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_utils.pxd:78:61: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_utils.pxd:110:56: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_utils.pxd:128:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_utils.pxd:130:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_utils.pxd:151:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  warning: deepforest/tree/_utils.pxd:152:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.
  performance hint: deepforest/tree/_splitter.pyx:30:5: Exception check on '_init_split' will always require the GIL to be acquired. Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
  performance hint: deepforest/tree/_splitter.pyx:463:5: Exception check on 'sort' will always require the GIL to be acquired. Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
  performance hint: deepforest/tree/_splitter.pyx:470:5: Exception check on 'swap' will always require the GIL to be acquired. Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
  performance hint: deepforest/tree/_splitter.pyx:499:5: Exception check on 'introsort' will always require the GIL to be acquired. Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
  performance hint: deepforest/tree/_splitter.pyx:532:5: Exception check on 'sift_down' will always require the GIL to be acquired. Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
  performance hint: deepforest/tree/_splitter.pyx:555:5: Exception check on 'heapsort' will always require the GIL to be acquired. Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
  performance hint: deepforest/tree/_splitter.pyx:947:5: Exception check on 'binary_search' will always require the GIL to be acquired. Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
  performance hint: deepforest/tree/_splitter.pyx:972:5: Exception check on 'extract_nnz_index_to_samples' will always require the GIL to be acquired. Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
  performance hint: deepforest/tree/_splitter.pyx:1012:5: Exception check on 'extract_nnz_binary_search' will always require the GIL to be acquired. Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.
  performance hint: deepforest/tree/_splitter.pyx:1084:5: Exception check on 'sparse_swap' will always require the GIL to be acquired. Possible solutions:
        1. Declare the function as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on the function to allow an error code to be returned.

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
      if not is_samples_sorted[0]:
          n_samples = end - start
          memcpy(sorted_samples + start, samples + start,
                 n_samples * sizeof(SIZE_t))
          qsort(sorted_samples + start, n_samples, sizeof(SIZE_t),
                compare_SIZE_t)
                ^
  ------------------------------------------------------------

  deepforest/tree/_splitter.pyx:1040:14: Cannot assign type 'int (const void *, const void *) except? -1 nogil' to 'int (*)(const void *, const void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'int (const void *, const void *) except? -1 nogil'.
  Appending deepforest.tree configuration to deepforest
  Ignoring attempt to set 'name' (from 'deepforest' to 'deepforest.tree')
  Compiling deepforest/tree/_tree.pyx because it changed.
  Compiling deepforest/tree/_splitter.pyx because it changed.
  Compiling deepforest/tree/_criterion.pyx because it depends on /private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/Cython/Includes/libc/string.pxd.
  Compiling deepforest/tree/_utils.pyx because it changed.
  Compiling deepforest/_forest.pyx because it depends on /private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/Cython/Includes/libc/string.pxd.
  Compiling deepforest/_cutils.pyx because it depends on /private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/Cython/Includes/libc/string.pxd.
  [1/6] Cythonizing deepforest/tree/_splitter.pyx
  Traceback (most recent call last):
    File "/Users/sgp28/miniforge3/envs/DFtest/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/sgp28/miniforge3/envs/DFtest/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 "/Users/sgp28/miniforge3/envs/DFtest/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/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in prepare_metadata_for_build_wheel
      self.run_setup()
    File "/private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 267, in run_setup
      super(_BuildMetaLegacyBackend,
    File "/private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 39, in <module>
      setup(
    File "/private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/numpy/distutils/core.py", line 135, in setup
      config = configuration()
    File "setup.py", line 26, in configuration
      config.add_subpackage("deepforest")
    File "/private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/numpy/distutils/misc_util.py", line 1016, in add_subpackage
      config_list = self.get_subpackage(subpackage_name, subpackage_path,
    File "/private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/numpy/distutils/misc_util.py", line 982, in get_subpackage
      config = self._get_configuration_from_setup_py(
    File "/private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/numpy/distutils/misc_util.py", line 924, in _get_configuration_from_setup_py
      config = setup_module.configuration(*args)
    File "deepforest/setup.py", line 52, in configuration
      config.ext_modules = cythonize(config.ext_modules)
    File "/private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
      cythonize_one(*args)
    File "/private/var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/pip-build-env-8t82u940/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: deepforest/tree/_splitter.pyx
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /Users/sgp28/miniforge3/envs/DFtest/bin/python /Users/sgp28/miniforge3/envs/DFtest/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /var/folders/sk/705pffl95sv3nzj0n2ls78cc0000gp/T/tmp55utq93x
  cwd: /Users/sgp28/Desktop/Delivery/Ph.D./tmp/Deep-Forest
  Preparing metadata (pyproject.toml) ... error
error: metadata-generation-failed

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

Additional Information:

I had previously managed to get the library working on an older MacBook (non-Apple Silicon) a year or two ago without any issues. However, I've spent a considerable amount of time today trying to get it working on my current system, and I am quite frustrated at the lack of progress.

Would appreciate very much any guidance or potential solutions to address this issue.

Thank you so much for your great novelty with Deep forest :)

Cheers

xuyxu commented 1 year ago

Hi @simonprovost, please consider to lower the version of Cython and see if it helps.

xuyxu commented 1 year ago

According to the release history of Cython, the version number directly increases from 0.29 to 3.0, and there could be a lot of compatiability problems.

simonprovost commented 1 year ago

Hello @xuyxu,

Thank you for your swift reply 👌 I attempted to set up a conda environment using Python 3.9.18 and tried installing Cython versions 0.20 through 0.28 using the command python -m pip install cython==0.X, where X{20, 21, 22, ..., 28}. However, all attempts resulted in unsuccessful installations accompanied by numerous errors.

I would greatly appreciate it if you could share the specific versions of Python and Cython that are compatible with DeepForest. This information will help us troubleshoot further, and we'll be able to provide logs if we encounter any additional issues.

Cheers 👋

simonprovost commented 1 year ago

Maybe provide your conda env pip list, we'll try to mirror that?

xuyxu commented 1 year ago

I have tested on my Macbook Air (M2), and the classification demo in README.md works fine.

IMPORTANT: There is no need to build the library from source, please use pip install deep-forest.

simonprovost commented 1 year ago

Fantastic! We're making progress 👌

I've successfully installed numpy, scikit, joblib, and your specified version of Cython. However, I hit a snag when pip install deep-forest failed. This was the initial issue I faced before I attempted solution #6.

Here are additional details, given that I am operating within a conda environment activated under Python 3.9:

Installed Packages:

/pip list                     (TMP_ENV) 
Package            Version
------------------ ---------
Brotli             1.1.0
certifi            2023.7.22
charset-normalizer 3.3.0
Cython             0.29.28
idna               3.4
joblib             1.1.0
numpy              1.21.5
packaging          23.2
pip                23.2.1
platformdirs       3.11.0
pooch              1.7.0
PySocks            1.7.1
requests           2.31.0
scikit-learn       1.0.2
scipy              1.10.1
setuptools         68.2.2
threadpoolctl      3.2.0
typing_extensions  4.8.0
urllib3            2.0.6
wheel              0.41.2

Pip Version:

pip --version                (TMP_ENV) 
pip 23.2.1 from [...]miniforge3/envs/TMP_ENV/lib/python3.9/site-packages/pip (python 3.9)

Issue with Installing deep-forest:

pip install deep-forest      (TMP_ENV) 
ERROR: Could not find a version that satisfies the requirement deep-forest (from versions: none)

# Note: I attempted specifying deep-forest==0.1.7 and others, yet no luck—it seems unable to locate the actual pip package.

pip install deep-forest==0.7   (TMP_ENV) 
ERROR: Could not find a version that satisfies the requirement deep-forest==0.1.7 (from versions: none)
ERROR: No matching distribution found for deep-forest==0.1.7

Any insights? We seem to be on the brink of resolving this !

I greatly appreciate your assistance once more @xuyxu!

Cheers,

xuyxu commented 1 year ago

Here is the running result of mine:

截屏2023-10-11 22 44 04

Could you download this wheel from here, and see if pip install {name}.wheel works.

simonprovost commented 1 year ago

I am eagerly looking forward to having deep-forest operational on my machine as well but unfortunately have again encountered some hurdles during the installation process. Despite successfully resolving the prior Cython issue, I am now facing challenges with installing the deep-forest wheel. See below further👌

System Specifications:

OSX: 14.0 (23A344)
CPU: Apple M2 (8 cores, 8 threads)
conda version: 23.7.2
pip version: 23.2.1 (with PY version: Python 3.9)

Installation Attempts:

I've tried both curl and pip commands to install the proposed wheel, but to no avail. Here's the error message I received:

ERROR: deep_forest-0.1.7-cp39-cp39-macosx_10_9_x86_64.whl is not a supported wheel on this platform.

Despite the error, I also attempted to install other available wheels, although they were not aligned with my Python version (3.9) and OS but just by any curiosity. Yet to no success again. Lastly, I can also confirm that my pip and wheel are updated, yet the issue persists.

Any insights or suggestions.. am afraid that you come to a dead end at some points, but thanks in any event to your great support !

EDIT 1.0: I just realised that I am using miniforge3 instead of anaconda3 package manager. Might that be the case? I am far from convinced though

xuyxu commented 1 year ago

Could you try if using the Python and pip from Anaconda (which provides a version optimized for M1/M2) helps? You can find the download link here.

simonprovost commented 1 year ago

Hi @xuyxu ,

Downloaded Anaconda and ensured my newly created conda environment was contained within anaconda and not miniforge anymore. I have installed the prerequisites you provided above. Then, I attempted to install, by ensuring that the pip of the conda environment is functioning properly prior to anything (i.e., making sure this is the pip of the anaconda env), deep-forest, yet I am having the same error:

[...]/anaconda3/envs/deepforesrt/bin/pip install deep-forest $

ERROR: Could not find a version that satisfies the requirement deep-forest (from versions: none)
ERROR: No matching distribution found for deep-forest

Next, I cloned the repository and attempted to compile by source using the current anaconda environment, but the same error occurred as per the cython splitter based issue mentionned earlier.

What is wrong with my situation 🧐 I am very much lost. Soon, I'll attempt to reinstall all that on a university-owned UNIX cloud workstation, but I encountered the same error as described in this message a few days ago.

If you have last thought, I'd be so very much grateful :)

So sorry for this annoying issue ! Cheers


ANACONDA V (General Conda Info):

 conda info                                                                                                (deepforesrt) 

     active environment : deepforesrt
    active env location : [...]/anaconda3/envs/deepforesrt
            shell level : 3
       user config file : [...]/.condarc
 populated config files : [...]/.condarc
          conda version : 23.7.4
    conda-build version : 3.26.1
         python version : 3.11.5.final.0
       virtual packages : __archspec=1=arm64
                          __osx=14.0=0
                          __unix=0=0
       base environment : [...]/anaconda3  (writable)
      conda av data dir :  [...]/anaconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : [...]/anaconda3/pkgs
                         [...]/.conda/pkgs
       envs directories :[...]/anaconda3/envs
                         [...]/.conda/envs
               platform : osx-arm64
             user-agent : conda/23.7.4 requests/2.31.0 CPython/3.11.5 Darwin/23.0.0 OSX/14.0 aau/0.4.2 c/EvJX_zyd1e6meTODjVe_qw s/lBpQahJvyK8y8vpo6U_X8w e/pWa2DGIJipu6UJWQfGB__Q
                UID:GID : 502:20
             netrc file : None
           offline mode : False

ANACONDA PIP V:

[..]/anaconda3/envs/deepforesrt/bin/pip --version                                             (deepforesrt) 
pip 23.2.1 from [..]/anaconda3/envs/deepforesrt/lib/python3.9/site-packages/pip (python 3.9)
xuyxu commented 1 year ago

Here is my conda info:

(base) xuyxu@Yi-XuandeAir ~ % conda info

     active environment : base
    active env location : /Users/xuyxu/opt/anaconda3
            shell level : 1
       user config file : /Users/xuyxu/.condarc
 populated config files :
          conda version : 4.13.0
    conda-build version : 3.21.8
         python version : 3.9.12.final.0
       virtual packages : __osx=10.16=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/xuyxu/opt/anaconda3  (writable)
      conda av data dir : /Users/xuyxu/opt/anaconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/xuyxu/opt/anaconda3/pkgs
                          /Users/xuyxu/.conda/pkgs
       envs directories : /Users/xuyxu/opt/anaconda3/envs
                          /Users/xuyxu/.conda/envs
               platform : osx-64
             user-agent : conda/4.13.0 requests/2.27.1 CPython/3.9.12 Darwin/23.0.0 OSX/10.16
                UID:GID : 501:20
             netrc file : None
           offline mode : False

and here is my pip version:

(base) xuyxu@Yi-XuandeAir ~ % pip --version
pip 21.2.4 from /Users/xuyxu/opt/anaconda3/lib/python3.9/site-packages/pip (python 3.9)

It looks like your virtual environment is with Python 3.11, which is too new. Also, it lacks the x86 channel for searching packages. Maybe you should install the Anaconda with Intel Chip ? (see the difference on tag platform between us)

simonprovost commented 1 year ago

Hello @xuyxu

I am appreciative of your support !! things ultimately went smoothly. I am able to run DeepForest :)

For readers experiencing the same issue. I would suggest uninstalling miniforge3 and anaconda from your computer. Download anaconda again, Intel or Apple silicon (not tested), and repeat the procedure. Make sure to try matching as much as possible @xuyxu's configurations and you should be fine (especially python 3.9 and Cython 0.29.X).

@xuyxu any perspective for adapting DF to Python 3.10 based projects?

Cheers