amphibian-dev / toad

ESC Team's credit scorecard tools.
https://toad.readthedocs.io
MIT License
474 stars 173 forks source link

Error Installation #129

Open hanhandata opened 1 year ago

hanhandata commented 1 year ago

Hi @Secbone and All,

I have stuck about installation, do you know about error the below ?

 cdef number[:] c_sum_axis_1(number[:,:] arr):
          cdef number[:] res = np.zeros(arr.shape[0], dtype=float)
               ^
      ------------------------------------------------------------

      toad/c_utils.pyx:40:9: 'number' is not a type identifier
      Compiling toad/c_utils.pyx because it changed.
      Compiling toad/merge.pyx because it changed.
      [1/2] Cythonizing toad/c_utils.pyx
      Traceback (most recent call last):
        File "/Users/nbmhqa114/anaconda3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/nbmhqa114/anaconda3/lib/python3.10/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/nbmhqa114/anaconda3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/s_/2cqjhlf54rd53_wlvmjgvcv80000gn/T/pip-build-env-57tm1n23/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/s_/2cqjhlf54rd53_wlvmjgvcv80000gn/T/pip-build-env-57tm1n23/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/s_/2cqjhlf54rd53_wlvmjgvcv80000gn/T/pip-build-env-57tm1n23/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 59, in <module>
        File "<string>", line 27, in get_ext_modules
        File "/private/var/folders/s_/2cqjhlf54rd53_wlvmjgvcv80000gn/T/pip-build-env-57tm1n23/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/s_/2cqjhlf54rd53_wlvmjgvcv80000gn/T/pip-build-env-57tm1n23/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: toad/c_utils.pyx
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
image

Han

Secbone commented 1 year ago

@hanhandata could you try to update your cython version or install toad from whl file from pypi?

hanhandata commented 1 year ago

Hi @Secbone I will try

septem9908 commented 10 months ago

python 3.10.12 cython 3.0.4 (most updated) pip 23.3.1 (most updated) failed to install toad 0.1.2, with the same error message above

kulig1985 commented 10 months ago

Same happens for me.. Any solution?

Secbone commented 9 months ago

python 3.10.12 cython 3.0.4 (most updated) pip 23.3.1 (most updated) failed to install toad 0.1.2, with the same error message above

@septem9908 what is your numpy version? could your has some error details?

Secbone commented 9 months ago

Same happens for me.. Any solution?

@kulig1985 have some details?

DjokerR commented 6 months ago

os: openeuler-arm64 python: 3.9.17

1、下载toad-0.1.3.tar.gz 并解压到/tmp 目录下 tar -zxvf toad-0.1.3.tar.gz -C /tmp/

2、 pip --version 找到python site-packages 路径 比如我的是/opt/conda/lib/python3.9/site-packages

3、将解压后的toad下所有的文件拷贝到site-packages 路径下 cp -r /tmp/toad-0.1.3/* /opt/conda/lib/python3.9/site-packages

4、到site-packages 路径下 pip install toad cd /opt/conda/lib/python3.9/site-packages && pip install toad

5、到任意目录下执行python -c "import toad ;print(toad.version)"

6、注意: 如果不将toad 放到python site-packages目录下,是无法在任意目录import toad

willyoung7077 commented 2 months ago

@hanhandata and all,

I think I can end this issue

There are two steps to solve this problem.

Step1: According to my experiences. This issue only happens on MacOS. Like Mine: Apple M2/ Platform: osx-arm64

If you're not sure what platform your MacOS is, uname -a in MacOS Terminal, Darwin localhost 23.2.0 Darwin Kernel Version 23.2.0 .... arm64

arm64 is the key point.

There are a lot of things not doing well on osx-arm64, like python 3.7

solution: highly-voted answer https://stackoverflow.com/questions/70205633/cannot-install-python-3-7-on-osx-arm64

conda create -n py37
conda activate py37
#key code:
conda config --env --set subdir osx-64
conda install python=3.7

The version of python doesn't matter

your osx-arm64 changes to osx-64

Step2:

Do not use pip install toad

still return error

Use conda install toad
add --channel conda-forge or not

will@localhost ~ % conda install toad  --channel conda-forge
Channels:
 - conda-forge
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
 - defaults
Platform: osx-64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/will/anaconda3/envs/python38

  added / updated specs:
    - toad

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    brotli-python-1.1.0        |   py38h940360d_1         358 KB  conda-forge
    charset-normalizer-3.3.2   |     pyhd8ed1ab_0          46 KB  conda-forge
    contourpy-1.1.1            |   py38h15a1a5b_1         212 KB  conda-forge
    cycler-0.12.1              |     pyhd8ed1ab_0          13 KB  conda-forge
    fonttools-4.53.0           |   py38hc718529_0         2.1 MB  conda-forge
    idna-3.7                   |     pyhd8ed1ab_0          51 KB  conda-forge
    importlib-resources-6.4.0  |     pyhd8ed1ab_0           9 KB  conda-forge
    importlib_resources-6.4.0  |     pyhd8ed1ab_0          32 KB  conda-forge
    joblib-1.4.2               |     pyhd8ed1ab_0         215 KB  conda-forge
    kiwisolver-1.4.5           |   py38h15a1a5b_1          59 KB  conda-forge
    lcms2-2.16                 |       ha2f27b4_0         219 KB  conda-forge
    libdeflate-1.20            |       h49d49c5_0          69 KB  conda-forge
    libjpeg-turbo-3.0.0        |       h0dc2134_1         566 KB  conda-forge
    libtiff-4.6.0              |       h129831d_3         251 KB  conda-forge
    libxcb-1.16                |       h0dc2134_0         315 KB  conda-forge
    matplotlib-base-3.7.3      |   py38hcd1b199_0         6.4 MB  conda-forge
    numpy-1.24.4               |   py38h9a4a08f_0         6.0 MB  conda-forge
    openjpeg-2.5.2             |       h7310d3a_0         324 KB  conda-forge
    packaging-24.1             |     pyhd8ed1ab_0          49 KB  conda-forge
    pandas-2.0.3               |   py38h78e6021_1        11.0 MB  conda-forge
    pillow-10.3.0              |   py38hf802781_1        39.8 MB  conda-forge
    platformdirs-4.2.2         |     pyhd8ed1ab_0          20 KB  conda-forge
    pooch-1.8.2                |     pyhd8ed1ab_0          53 KB  conda-forge
    pysocks-1.7.1              |     pyha2e5f31_6          19 KB  conda-forge
    python-tzdata-2024.1       |     pyhd8ed1ab_0         141 KB  conda-forge
    python_abi-3.8             |           4_cp38           6 KB  conda-forge
    requests-2.32.3            |     pyhd8ed1ab_0          57 KB  conda-forge
    scikit-learn-1.3.2         |   py38h43a65be_2         7.1 MB  conda-forge
    scipy-1.10.1               |   py38h9cf86d3_3        14.7 MB  conda-forge
    seaborn-0.13.2             |       hd8ed1ab_2           7 KB  conda-forge
    seaborn-base-0.13.2        |     pyhd8ed1ab_2         229 KB  conda-forge
    statsmodels-0.14.1         |   py38h7092abf_0        10.0 MB  conda-forge
    threadpoolctl-3.5.0        |     pyhc1e730c_0          23 KB  conda-forge
    toad-0.1.0                 |   py38hef030d1_2        12.7 MB  conda-forge
    unicodedata2-15.1.0        |   py38hcafd530_0         361 KB  conda-forge
    urllib3-2.2.2              |     pyhd8ed1ab_0          93 KB  conda-forge
    zipp-3.19.2                |     pyhd8ed1ab_0          20 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       113.5 MB

The following NEW packages will be INSTALLED:

  brotli             conda-forge/osx-64::brotli-1.1.0-h0dc2134_1 
  brotli-bin         conda-forge/osx-64::brotli-bin-1.1.0-h0dc2134_1 
  brotli-python      conda-forge/osx-64::brotli-python-1.1.0-py38h940360d_1 
  certifi            conda-forge/noarch::certifi-2024.6.2-pyhd8ed1ab_0 
  charset-normalizer conda-forge/noarch::charset-normalizer-3.3.2-pyhd8ed1ab_0 
  contourpy          conda-forge/osx-64::contourpy-1.1.1-py38h15a1a5b_1 
  cycler             conda-forge/noarch::cycler-0.12.1-pyhd8ed1ab_0 
  fonttools          conda-forge/osx-64::fonttools-4.53.0-py38hc718529_0 
  freetype           conda-forge/osx-64::freetype-2.12.1-h60636b9_2 
  idna               conda-forge/noarch::idna-3.7-pyhd8ed1ab_0 
  importlib-resourc~ conda-forge/noarch::importlib-resources-6.4.0-pyhd8ed1ab_0 
  importlib_resourc~ conda-forge/noarch::importlib_resources-6.4.0-pyhd8ed1ab_0 
  joblib             conda-forge/noarch::joblib-1.4.2-pyhd8ed1ab_0 
  kiwisolver         conda-forge/osx-64::kiwisolver-1.4.5-py38h15a1a5b_1 
  lcms2              conda-forge/osx-64::lcms2-2.16-ha2f27b4_0 
  lerc               conda-forge/osx-64::lerc-4.0.0-hb486fe8_0 
  libblas            conda-forge/osx-64::libblas-3.9.0-20_osx64_openblas 
  libbrotlicommon    conda-forge/osx-64::libbrotlicommon-1.1.0-h0dc2134_1 
  libbrotlidec       conda-forge/osx-64::libbrotlidec-1.1.0-h0dc2134_1 
  libbrotlienc       conda-forge/osx-64::libbrotlienc-1.1.0-h0dc2134_1 
  libcblas           conda-forge/osx-64::libcblas-3.9.0-20_osx64_openblas 
  libcxx             conda-forge/osx-64::libcxx-17.0.6-h88467a6_0 
  libdeflate         conda-forge/osx-64::libdeflate-1.20-h49d49c5_0 
  libgfortran        conda-forge/osx-64::libgfortran-5.0.0-13_2_0_h97931a8_3 
  libgfortran5       conda-forge/osx-64::libgfortran5-13.2.0-h2873a65_3 
  libjpeg-turbo      conda-forge/osx-64::libjpeg-turbo-3.0.0-h0dc2134_1 
  liblapack          conda-forge/osx-64::liblapack-3.9.0-20_osx64_openblas 
  libopenblas        conda-forge/osx-64::libopenblas-0.3.25-openmp_hfef2a42_0 
  libpng             conda-forge/osx-64::libpng-1.6.43-h92b6c6a_0 
  libtiff            conda-forge/osx-64::libtiff-4.6.0-h129831d_3 
  libwebp-base       conda-forge/osx-64::libwebp-base-1.4.0-h10d778d_0 
  libxcb             conda-forge/osx-64::libxcb-1.16-h0dc2134_0 
  llvm-openmp        conda-forge/osx-64::llvm-openmp-18.1.8-h15ab845_0 
  matplotlib-base    conda-forge/osx-64::matplotlib-base-3.7.3-py38hcd1b199_0 
  munkres            conda-forge/noarch::munkres-1.1.4-pyh9f0ad1d_0 
  numpy              conda-forge/osx-64::numpy-1.24.4-py38h9a4a08f_0 
  openjpeg           conda-forge/osx-64::openjpeg-2.5.2-h7310d3a_0 
  packaging          conda-forge/noarch::packaging-24.1-pyhd8ed1ab_0 
  pandas             conda-forge/osx-64::pandas-2.0.3-py38h78e6021_1 
  patsy              conda-forge/noarch::patsy-0.5.6-pyhd8ed1ab_0 
  pillow             conda-forge/osx-64::pillow-10.3.0-py38hf802781_1 
  platformdirs       conda-forge/noarch::platformdirs-4.2.2-pyhd8ed1ab_0 
  pooch              conda-forge/noarch::pooch-1.8.2-pyhd8ed1ab_0 
  pthread-stubs      conda-forge/osx-64::pthread-stubs-0.4-hc929b4f_1001 
  pyparsing          conda-forge/noarch::pyparsing-3.1.2-pyhd8ed1ab_0 
  pysocks            conda-forge/noarch::pysocks-1.7.1-pyha2e5f31_6 
  python-dateutil    conda-forge/noarch::python-dateutil-2.9.0-pyhd8ed1ab_0 
  python-tzdata      conda-forge/noarch::python-tzdata-2024.1-pyhd8ed1ab_0 
  python_abi         conda-forge/osx-64::python_abi-3.8-4_cp38 
  pytz               conda-forge/noarch::pytz-2024.1-pyhd8ed1ab_0 
  requests           conda-forge/noarch::requests-2.32.3-pyhd8ed1ab_0 
  scikit-learn       conda-forge/osx-64::scikit-learn-1.3.2-py38h43a65be_2 
  scipy              conda-forge/osx-64::scipy-1.10.1-py38h9cf86d3_3 
  seaborn            conda-forge/noarch::seaborn-0.13.2-hd8ed1ab_2 
  seaborn-base       conda-forge/noarch::seaborn-base-0.13.2-pyhd8ed1ab_2 
  six                conda-forge/noarch::six-1.16.0-pyh6c4a22f_0 
  statsmodels        conda-forge/osx-64::statsmodels-0.14.1-py38h7092abf_0 
  threadpoolctl      conda-forge/noarch::threadpoolctl-3.5.0-pyhc1e730c_0 
  toad               conda-forge/osx-64::toad-0.1.0-py38hef030d1_2 
  unicodedata2       conda-forge/osx-64::unicodedata2-15.1.0-py38hcafd530_0 
  urllib3            conda-forge/noarch::urllib3-2.2.2-pyhd8ed1ab_0 
  xorg-libxau        conda-forge/osx-64::xorg-libxau-1.0.11-h0dc2134_0 
  xorg-libxdmcp      conda-forge/osx-64::xorg-libxdmcp-1.1.3-h35c211d_0 
  zipp               conda-forge/noarch::zipp-3.19.2-pyhd8ed1ab_0 
  zstd               conda-forge/osx-64::zstd-1.5.6-h915ae27_0 

The following packages will be SUPERSEDED by a higher-priority channel:

  ca-certificates    conda-forge/osx-arm64::ca-certificate~ --> conda-forge/osx-64::ca-certificates-2024.6.2-h8857fd0_0 
  openssl            conda-forge/osx-arm64::openssl-3.3.1-~ --> conda-forge/osx-64::openssl-3.3.1-h87427d6_0 

Proceed ([y]/n)? y

Downloading and Extracting Packages:

Preparing transaction: done                                                                                                                        
Verifying transaction: done                                                                                                                        
Executing transaction: done          

PS: As for another setup method: https://github.com/amphibian-dev/toad

Source code python setup.py install

I didn't try .

This issue takes me a lot of time to solve it , wish you have a good day , dudes