Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SCIKIT learn failure in mac
#1
Hello

While installing SCIKIT-LEARN on MAC it failed

Could someone please help on what i need to be looking.

Jags-MacBook-Air:~ jag$ pip3 install scikit-learn

Collecting scikit-learn

Downloading https://files.pythonhosted.org/packages/...1.3.tar.gz (12.2MB)

|████████████████████████████████| 12.2MB 1.4MB/s

Requirement already satisfied: numpy>=1.11.0 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from scikit-learn) (1.17.4)

Requirement already satisfied: scipy>=0.17.0 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from scikit-learn) (1.3.3)

Collecting joblib>=0.11 (from scikit-learn)

Downloading https://files.pythonhosted.org/packages/...ne-any.whl (294kB)

|████████████████████████████████| 296kB 979kB/s

Installing collected packages: joblib, scikit-learn

Running setup.py install for scikit-learn ... error

ERROR: Command errored out with exit status 1:

command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_4/hxl9577j27z87t2b7b516jv40000gn/T/pip-install-1bwoznca/scikit-learn/setup.py'"'"'; __file__='"'"'/private/var/folders/_4/hxl9577j27z87t2b7b516jv40000gn/T/pip-install-1bwoznca/scikit-learn/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/_4/hxl9577j27z87t2b7b516jv40000gn/T/pip-record-fcqytin5/install-record.txt --single-version-externally-managed --compile

cwd: /private/var/folders/_4/hxl9577j27z87t2b7b516jv40000gn/T/pip-install-1bwoznca/scikit-learn/

Complete output (28 lines):

Partial import of sklearn during the build process.

Traceback (most recent call last):

File "<string>", line 1, in <module>

File "/private/var/folders/_4/hxl9577j27z87t2b7b516jv40000gn/T/pip-install-1bwoznca/scikit-learn/setup.py", line 290, in <module>

setup_package()

File "/private/var/folders/_4/hxl9577j27z87t2b7b516jv40000gn/T/pip-install-1bwoznca/scikit-learn/setup.py", line 286, in setup_package

setup(**metadata)

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/distutils/core.py", line 137, in setup

config = configuration()

File "/private/var/folders/_4/hxl9577j27z87t2b7b516jv40000gn/T/pip-install-1bwoznca/scikit-learn/setup.py", line 174, in configuration

config.add_subpackage('sklearn')

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/distutils/misc_util.py", line 1033, in add_subpackage

config_list = self.get_subpackage(subpackage_name, subpackage_path,

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/distutils/misc_util.py", line 999, in get_subpackage

config = self._get_configuration_from_setup_py(

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/distutils/misc_util.py", line 941, in _get_configuration_from_setup_py

config = setup_module.configuration(*args)

File "sklearn/setup.py", line 62, in configuration

config.add_subpackage('utils')

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/distutils/misc_util.py", line 1033, in add_subpackage

config_list = self.get_subpackage(subpackage_name, subpackage_path,

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/distutils/misc_util.py", line 999, in get_subpackage

config = self._get_configuration_from_setup_py(

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/distutils/misc_util.py", line 941, in _get_configuration_from_setup_py

config = setup_module.configuration(*args)

File "sklearn/utils/setup.py", line 8, in configuration

from Cython import Tempita

ModuleNotFoundError: No module named 'Cython'

----------------------------------------

ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_4/hxl9577j27z87t2b7b516jv40000gn/T/pip-install-1bwoznca/scikit-learn/setup.py'"'"'; __file__='"'"'/private/var/folders/_4/hxl9577j27z87t2b7b516jv40000gn/T/pip-install-1bwoznca/scikit-learn/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/_4/hxl9577j27z87t2b7b516jv40000gn/T/pip-record-fcqytin5/install-record.txt --single-version-externally-managed --compile Check the logs for full command output
Reply
#2
Try:
pip3 install --upgrade cython
Also try in a virtual environment,it's build into Python now trough venv.
# Make 
python3 -m venv sci_env
 
# Cd in
cd sci_env
 
# Activate
source bin/activate  

# Install
(sci_env) mint@mint $
pip3 install cython
pip3 install scikit-learn
I have seen this message a couple of time now,
it can have to do with 3.8 and that some 3-party lib that have to do a fix for 3.8.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Failure to run source command middlestudent 2 656 Sep-22-2023, 01:21 PM
Last Post: buran
  Having trouble installing scikit-learn via VSC and pulling my hair out pythonturtle 1 716 Feb-07-2023, 02:23 AM
Last Post: Larz60+
  Dickey Fuller failure Led_Zeppelin 4 2,531 Sep-15-2022, 09:07 PM
Last Post: Led_Zeppelin
  Assert failure jtcostel 1 1,614 Sep-03-2021, 05:28 PM
Last Post: buran
  xml decoding failure(bs4) roughstroke 1 2,210 May-09-2020, 04:37 PM
Last Post: snippsat
  failure to find modules justus123 2 4,200 Dec-14-2018, 04:28 PM
Last Post: nilamo
  LIB install failure Able98 2 3,882 Jun-07-2017, 06:41 PM
Last Post: Able98
  Scikit Image Processing DanielAustin91 1 3,919 Jan-02-2017, 08:14 PM
Last Post: Mekire

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020