Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit code 1 while pip installing library #1675

Open
Adi-ds opened this issue Jul 18, 2023 · 21 comments
Open

Exit code 1 while pip installing library #1675

Adi-ds opened this issue Jul 18, 2023 · 21 comments

Comments

@Adi-ds
Copy link

Adi-ds commented Jul 18, 2023

Describe the bug

Library not installing, while installing with pip install auto-sklearn

To Reproduce

Steps to reproduce the behavior:

  • Execute command pip install auto-sklearn (python 3.10)

Expected behavior

The library should have got installed

Actual behavior, stacktrace or logfile

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
  ╰─> [825 lines of output]
      <string>:17: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      Partial import of sklearn during the build process.
      <string>:116: DeprecationWarning:
      
        `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
        of the deprecation of `distutils` itself. It will be removed for
        Python >= 3.12. For older Python versions it will remain present.
        It is recommended to use `setuptools < 60.0` for those Python versions.
        For more details, see:
          https://numpy.org/devdocs/reference/distutils_status_migration.html  
Error compiling Cython file:
      ------------------------------------------------------------
      ...
              if n_used_bins <= 1:
                  free(cat_infos)
                  return
      
              qsort(cat_infos, n_used_bins, sizeof(categorical_info),
                    compare_cat_infos)
                    ^
      ------------------------------------------------------------

sklearn/ensemble/_hist_gradient_boosting/splitting.pyx:912:14: Cannot assign type 'int (const void *, const void *) except? -1 nogil' to 'int (*)(const void *, const void *) noexcept nogil'
      Traceback (most recent call last):
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
          return cythonize_one(*m)
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: sklearn/ensemble/_hist_gradient_boosting/splitting.pyx
warning: sklearn/neighbors/_dist_metrics.pxd:77:67: 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.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              # determine number of levels in the tree, and from this
              # the number of nodes in the tree.  This results in leaf nodes
              # with numbers of points between leaf_size and 2 * leaf_size
              self.n_levels = int(
                  np.log2(fmax(1, (n_samples - 1) / self.leaf_size)) + 1)
              self.n_nodes = (2 ** self.n_levels) - 1
                                                  ^
      ------------------------------------------------------------
      
      sklearn/neighbors/_binary_tree.pxi:1079:44: Cannot assign type 'double' to 'ITYPE_t'
      Traceback (most recent call last):
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
          return cythonize_one(*m)
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: sklearn/neighbors/_ball_tree.pyx
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          def __cinit__(self, int n_dimensions, int verbose):
              """Constructor."""
              # Parameters of the tree
              self.n_dimensions = n_dimensions
              self.verbose = verbose
              self.n_cells_per_cell = 2 ** self.n_dimensions
                                        ^
      ------------------------------------------------------------
      
      sklearn/neighbors/_quad_tree.pyx:60:34: Cannot assign type 'double' to 'SIZE_t'
      Traceback (most recent call last):
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
          return cythonize_one(*m)
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: sklearn/neighbors/_quad_tree.pyx
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              free_problem(problem)
              free_parameter(param)
              raise ValueError(error_msg)
      
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
                                   ^
      ------------------------------------------------------------
      
      sklearn/svm/_liblinear.pyx:55:29: Cannot assign type 'double (int, double *, int, double *, int) except * nogil' to 'dot_func'
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              free_parameter(param)
              raise ValueError(error_msg)
      
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
          blas_functions.axpy = _axpy[double]
                                     ^
      ------------------------------------------------------------
      
      sklearn/svm/_liblinear.pyx:56:31: Cannot assign type 'void (int, double, double *, int, double *, int) except * nogil' to 'axpy_func'
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              raise ValueError(error_msg)
      
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
          blas_functions.axpy = _axpy[double]
          blas_functions.scal = _scal[double]
                                     ^
      ------------------------------------------------------------
      
      sklearn/svm/_liblinear.pyx:57:31: Cannot assign type 'void (int, double, double *, int) except * nogil' to 'scal_func'
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
          blas_functions.axpy = _axpy[double]
          blas_functions.scal = _scal[double]
          blas_functions.nrm2 = _nrm2[double]
                                     ^
      ------------------------------------------------------------
      
      sklearn/svm/_liblinear.pyx:58:31: Cannot assign type 'double (int, double *, int) except * nogil' to 'nrm2_func'
      Traceback (most recent call last):
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
          return cythonize_one(*m)
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: sklearn/svm/_liblinear.pyx
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          if error_msg:
              # for SVR: epsilon is called p in libsvm
              error_repl = error_msg.decode('utf-8').replace("p < 0", "epsilon < 0")
              raise ValueError(error_repl)
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
                                   ^
      ------------------------------------------------------------
      
      sklearn/svm/_libsvm.pyx:194:29: Cannot assign type 'double (int, double *, int, double *, int) except * nogil' to 'dot_func'
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                             class_weight_label.data, class_weight.data)
          model = set_model(&param, <int> nSV.shape[0], SV.data, SV.shape,
                            support.data, support.shape, sv_coef.strides,
                            sv_coef.data, intercept.data, nSV.data, probA.data, probB.data)
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
                                   ^
      ------------------------------------------------------------
      
      sklearn/svm/_libsvm.pyx:358:29: Cannot assign type 'double (int, double *, int, double *, int) except * nogil' to 'dot_func'
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                            sv_coef.data, intercept.data, nSV.data,
                            probA.data, probB.data)
      
          cdef np.npy_intp n_class = get_nr(model)
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
                                   ^
      ------------------------------------------------------------
      
      sklearn/svm/_libsvm.pyx:464:29: Cannot assign type 'double (int, double *, int, double *, int) except * nogil' to 'dot_func'
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              n_class = 1
          else:
              n_class = get_nr(model)
              n_class = n_class * (n_class - 1) // 2
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
                                   ^
      ------------------------------------------------------------
      
      sklearn/svm/_libsvm.pyx:570:29: Cannot assign type 'double (int, double *, int, double *, int) except * nogil' to 'dot_func'
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          if error_msg:
              raise ValueError(error_msg)
      
          cdef np.ndarray[np.float64_t, ndim=1, mode='c'] target
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
                                   ^
      ------------------------------------------------------------
      
      sklearn/svm/_libsvm.pyx:714:29: Cannot assign type 'double (int, double *, int, double *, int) except * nogil' to 'dot_func'
      Traceback (most recent call last):
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
          return cythonize_one(*m)
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: sklearn/svm/_libsvm.pyx
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          if error_msg:
              free_problem(problem)
              free_param(param)
              raise ValueError(error_msg)
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
                                   ^
      ------------------------------------------------------------
      
      sklearn/svm/_libsvm_sparse.pyx:153:29: Cannot assign type 'double (int, double *, int, double *, int) except * nogil' to 'dot_func'
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                                sv_coef.data, intercept.data,
                                nSV.data, probA.data, probB.data)
          #TODO: use check_model
          dec_values = np.empty(T_indptr.shape[0]-1)
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
                                   ^
      ------------------------------------------------------------
      
      sklearn/svm/_libsvm_sparse.pyx:284:29: Cannot assign type 'double (int, double *, int, double *, int) except * nogil' to 'dot_func'
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          #TODO: use check_model
          cdef np.npy_intp n_class = get_nr(model)
          cdef int rv
          dec_values = np.empty((T_indptr.shape[0]-1, n_class), dtype=np.float64)
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
                                   ^
      ------------------------------------------------------------
      
      sklearn/svm/_libsvm_sparse.pyx:343:29: Cannot assign type 'double (int, double *, int, double *, int) except * nogil' to 'dot_func'
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              n_class = get_nr(model)
              n_class = n_class * (n_class - 1) // 2
      
          dec_values = np.empty((T_indptr.shape[0] - 1, n_class), dtype=np.float64)
          cdef BlasFunctions blas_functions
          blas_functions.dot = _dot[double]
                                   ^
      ------------------------------------------------------------
      
      sklearn/svm/_libsvm_sparse.pyx:412:29: Cannot assign type 'double (int, double *, int, double *, int) except * nogil' to 'dot_func'
      Traceback (most recent call last):
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
          return cythonize_one(*m)
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: sklearn/svm/_libsvm_sparse.pyx
      
      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)
                    ^
      ------------------------------------------------------------
      
      sklearn/tree/_splitter.pyx:1037:14: Cannot assign type 'int (const void *, const void *) except? -1 nogil' to 'int (*)(const void *, const void *) noexcept nogil'
      Traceback (most recent call last):
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
          return cythonize_one(*m)
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: sklearn/tree/_splitter.pyx
Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
              # Initial capacity
              cdef int init_capacity
      
              if tree.max_depth <= 10:
                  init_capacity = (2 ** (tree.max_depth + 1)) - 1
                                                              ^
      ------------------------------------------------------------
      
      sklearn/tree/_tree.pyx:151:56: Cannot assign type 'double' to 'int'
      Traceback (most recent call last):
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1325, in cythonize_one_helper
          return cythonize_one(*m)
        File "/tmp/pip-build-env-at5n6u8u/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: sklearn/tree/_tree.pyx
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              dec(end)
              # Construct our arguments
              cdef pair[ITYPE_t, DTYPE_t] args
              args.first = key
              args.second = value
              self.my_map.insert(end, args)
                                 ^
      ------------------------------------------------------------
      Cython.Compiler.Errors.CompileError: sklearn/ensemble/_hist_gradient_boosting/splitting.pyx
      [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.

Environment and installation:

python 3.10

Please give details about your installation:

  • OS: Ubuntu 20.04.6 LTS
  • Is your installation in a virtual environment or conda environment? Yes (Virtual Environment)
  • Python version 3.10
  • Auto-sklearn version (latest)
@Ark2000
Copy link

Ark2000 commented Jul 18, 2023

I guess the project is probably dead now

@gabrielnovillorangone
Copy link

image
I have the same problem since yesterday, it goes as far as downloading scikit learn, this is in google colab, but it always worked

@AmirAlavi
Copy link

It's because of the new Cython release a few days ago, and its incompatibility with older scikit-learn. Workaround for now is to

  1. Install older Cython
  2. Make sure that scikit-learn uses that Cython when it's built

This answer does both of those.

@jfprieur
Copy link

Using Python 3.9 solves the issue as well

@eyalElb
Copy link

eyalElb commented Aug 25, 2023

Hii can you help me please?
Even python 3.9 doesn't work for me

Google colab notebook

@eyalElb
Copy link

eyalElb commented Aug 25, 2023

Using Python 3.9 solves the issue as well

Hii iam trying to user python3.9 on google colab, did you try it?
Can see in my last comment what I did, can you help me solve the problem?

@eddiebergman
Copy link
Contributor

Did you try restarting the kernel after installing auto-sklearn?

@jfprieur
Copy link

Hii iam trying to user python3.9 on google colab, did you try it? Can see in my last comment what I did, can you help me solve the problem?

I do not use ipython or jupyter notebooks, only command line on Ubuntu 22.04 in a venv. Must be something else in your configuration that is causing the problem.

@eyalElb
Copy link

eyalElb commented Aug 25, 2023

Hii iam trying to user python3.9 on google colab, did you try it? Can see in my last comment what I did, can you help me solve the problem?

I do not use ipython or jupyter notebooks, only command line on Ubuntu 22.04 in a venv. Must be something else in your configuration that is causing the problem.

So when usign ubuntu even python3.10 works fine, only on google colab that does not work

@eyalElb
Copy link

eyalElb commented Aug 25, 2023

Did you try restarting the kernel after installing auto-sklearn?

after using restart runtime the session crash.
this is the error:
image

can see my notebook here

@eyalElb
Copy link

eyalElb commented Aug 25, 2023

And thank you both @jfprieur and @eddiebergman for helping

@eddiebergman
Copy link
Contributor

Don't uninstall Ipython is my best guess based on the fact it's looking for a kernel (powered by IPython)

@eyalElb
Copy link

eyalElb commented Aug 27, 2023

i have a a way to fix it, thank you all and thanks for @AmirAlavi to point it out in other issue.

https://colab.research.google.com/drive/1BXXdGaJX_HxOL-jaL747s_BLYAjPvmCH?usp=sharing

@gabrielnovillorangone
Copy link

gabrielnovillorangone commented Aug 28, 2023 via email

@Shellcat-Zero
Copy link

Thanks to Amir's comment, my install succeeded with:

pip install auto-sklearn --no-build-isolation

@gabrielnovillorangone
Copy link

gabrielnovillorangone commented Oct 8, 2023 via email

@stupidoge
Copy link

@Shellcat-Zero hi, do you use this pip install auto-sklearn --no-build-isolation and then pip install auto-sklearn in colab with a default python version as 3.10?

@Shellcat-Zero
Copy link

@Shellcat-Zero hi, do you use this pip install auto-sklearn --no-build-isolation and then pip install auto-sklearn in colab with a default python version as 3.10?

@stupidoge I'm not using colab (just my own Linux environment), but I am using python 3.10. After running into various bugs in auto-sklearn, and finding out that there is major (unreleased) refactoring work going on to fix issues in it, I've since moved on Python FLAML for the same use cases.

@stupidoge
Copy link

@gabrielnovillorangone Hi sir, did you solve that problem?

@gabrielnovillorangone
Copy link

gabrielnovillorangone commented Nov 15, 2023 via email

@dragon28
Copy link

dragon28 commented Mar 4, 2024

facing the same issue:

$ pip install scikit-learn==0.23 --no-build-isolation
Collecting scikit-learn==0.23
  Using cached scikit-learn-0.23.0.tar.gz (7.2 MB)
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
      Partial import of sklearn during the build process.
      running dist_info
      creating /tmp/pip-modern-metadata-bg3uuqnx/scikit_learn.egg-info
      writing /tmp/pip-modern-metadata-bg3uuqnx/scikit_learn.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-modern-metadata-bg3uuqnx/scikit_learn.egg-info/dependency_links.txt
      writing requirements to /tmp/pip-modern-metadata-bg3uuqnx/scikit_learn.egg-info/requires.txt
      writing top-level names to /tmp/pip-modern-metadata-bg3uuqnx/scikit_learn.egg-info/top_level.txt
      writing manifest file '/tmp/pip-modern-metadata-bg3uuqnx/scikit_learn.egg-info/SOURCES.txt'
      reading manifest file '/tmp/pip-modern-metadata-bg3uuqnx/scikit_learn.egg-info/SOURCES.txt'
      adding license file 'COPYING'
      writing manifest file '/tmp/pip-modern-metadata-bg3uuqnx/scikit_learn.egg-info/SOURCES.txt'
      creating '/tmp/pip-modern-metadata-bg3uuqnx/scikit_learn-0.23.0.dist-info'
      error: invalid command 'bdist_wheel'
      [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.

os:

$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

kernel:


$ uname -a
Linux unknown 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux

python version:


$ python --version
Python 3.10.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants