18

I am new to python and pip ecosystem. I am trying to install scikit-image and it is installing scipy as a dependency I suppose. I am using macOS 11.1 and I know that support for this version is not great since it just released but I was able to install packages like numpy, pillow just by changing few flags(LDFLAGS, CPPFLAGS).

Can someone tell me if I can resolve below installation errors by changing few configurations or not?

I already have openblas, mkl_rt libraries installed.

(trial) ~/.virtualenvs/trial python -m pip install scikit-image                                       
Collecting scikit-image
  Using cached scikit-image-0.17.2.tar.gz (29.8 MB)
Requirement already satisfied: numpy>=1.15.1 in ./lib/python3.6/site-packages (from scikit-image) (1.19.4)
Collecting scipy>=1.0.1
  Using cached scipy-1.5.4.tar.gz (25.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/myusername/.virtualenvs/trial/bin/python /Users/myusername/.virtualenvs/trial/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/ss/d2f4tvvn7fzc42ls4hbrw06h0000gn/T/tmpk55uptaz
         cwd: /private/var/folders/ss/d2f4tvvn7fzc42ls4hbrw06h0000gn/T/pip-install-1v5ec7uf/scipy
    Complete output (137 lines):
    lapack_opt_info:
    lapack_mkl_info:
    customize UnixCCompiler
      libraries mkl_rt not found in ['/Users/myusername/.virtualenvs/trial/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
    
    openblas_lapack_info:
    customize UnixCCompiler
    customize UnixCCompiler
      libraries openblas not found in ['/Users/myusername/.virtualenvs/trial/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
    
    openblas_clapack_info:
    customize UnixCCompiler
    customize UnixCCompiler
      libraries openblas,lapack not found in ['/Users/myusername/.virtualenvs/trial/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
    
    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
    customize UnixCCompiler
      libraries tatlas,tatlas not found in /Users/myusername/.virtualenvs/trial/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /Users/myusername/.virtualenvs/trial/lib
    customize UnixCCompiler
      libraries tatlas,tatlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries tatlas,tatlas not found in /usr/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE
    
    atlas_3_10_info:
    customize UnixCCompiler
      libraries satlas,satlas not found in /Users/myusername/.virtualenvs/trial/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /Users/myusername/.virtualenvs/trial/lib
    customize UnixCCompiler
      libraries satlas,satlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries satlas,satlas not found in /usr/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib
    <class 'numpy.distutils.system_info.atlas_3_10_info'>
      NOT AVAILABLE
    
    atlas_threads_info:
    Setting PTATLAS=ATLAS
    customize UnixCCompiler
      libraries ptf77blas,ptcblas,atlas not found in /Users/myusername/.virtualenvs/trial/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /Users/myusername/.virtualenvs/trial/lib
    customize UnixCCompiler
      libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries ptf77blas,ptcblas,atlas not found in /usr/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE
    
    atlas_info:
    customize UnixCCompiler
      libraries f77blas,cblas,atlas not found in /Users/myusername/.virtualenvs/trial/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /Users/myusername/.virtualenvs/trial/lib
    customize UnixCCompiler
      libraries f77blas,cblas,atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/local/lib
    customize UnixCCompiler
      libraries f77blas,cblas,atlas not found in /usr/lib
    customize UnixCCompiler
      libraries lapack_atlas not found in /usr/lib
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE
    
    lapack_info:
    customize UnixCCompiler
      libraries lapack not found in ['/Users/myusername/.virtualenvs/trial/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
    
    lapack_src_info:
      NOT AVAILABLE
    
      NOT AVAILABLE
    
    setup.py:462: UserWarning: Unrecognized setuptools command ('dist_info --egg-base /private/var/folders/ss/d2f4tvvn7fzc42ls4hbrw06h0000gn/T/pip-modern-metadata-tssa7s05'), proceeding with generating Cython sources and expanding templates
      ' '.join(sys.argv[1:])))
    Running from SciPy source directory.
    /private/var/folders/ss/d2f4tvvn7fzc42ls4hbrw06h0000gn/T/pip-build-env-_26ufpkr/overlay/lib/python3.6/site-packages/numpy/distutils/system_info.py:624: UserWarning:
        Atlas (http://math-atlas.sourceforge.net/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [atlas]) or by setting
        the ATLAS environment variable.
      self.calc_info()
    /private/var/folders/ss/d2f4tvvn7fzc42ls4hbrw06h0000gn/T/pip-build-env-_26ufpkr/overlay/lib/python3.6/site-packages/numpy/distutils/system_info.py:624: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      self.calc_info()
    /private/var/folders/ss/d2f4tvvn7fzc42ls4hbrw06h0000gn/T/pip-build-env-_26ufpkr/overlay/lib/python3.6/site-packages/numpy/distutils/system_info.py:624: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      self.calc_info()
    Traceback (most recent call last):
      File "/Users/myusername/.virtualenvs/trial/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
        main()
      File "/Users/myusername/.virtualenvs/trial/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/Users/myusername/.virtualenvs/trial/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/private/var/folders/ss/d2f4tvvn7fzc42ls4hbrw06h0000gn/T/pip-build-env-_26ufpkr/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 161, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/private/var/folders/ss/d2f4tvvn7fzc42ls4hbrw06h0000gn/T/pip-build-env-_26ufpkr/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 254, in run_setup
        self).run_setup(setup_script=setup_script)
      File "/private/var/folders/ss/d2f4tvvn7fzc42ls4hbrw06h0000gn/T/pip-build-env-_26ufpkr/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 145, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 583, in <module>
        setup_package()
      File "setup.py", line 579, in setup_package
        setup(**metadata)
      File "/private/var/folders/ss/d2f4tvvn7fzc42ls4hbrw06h0000gn/T/pip-build-env-_26ufpkr/overlay/lib/python3.6/site-packages/numpy/distutils/core.py", line 135, in setup
        config = configuration()
      File "setup.py", line 477, in configuration
        raise NotFoundError(msg)
    numpy.distutils.system_info.NotFoundError: No lapack/blas resources found. Note: Accelerate is no longer supported.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/myusername/.virtualenvs/trial/bin/python /Users/myusername/.virtualenvs/trial/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/ss/d2f4tvvn7fzc42ls4hbrw06h0000gn/T/tmpk55uptaz Check the logs for full command output.
G Patel
  • 181
  • 1
  • 3
  • 8
  • Do you have a strong reason to use Python 3.6? Most of the SciPy ecosystem stopped supporting 3.6 just before Big Sur came out, so you will find better support if you use a more recent Python. In fact I've only heard of people getting 3.9 working with Big Sur. – Juan Dec 18 '20 at 02:31
  • @Juan I was trying to use numpy with python 3.8 for my other project and I could not install it because of some issue with python version and big sur. So I used 3.6 from the beginning for this project. – G Patel Dec 18 '20 at 15:14
  • And have you tried 3.9? – Juan Dec 20 '20 at 09:17
  • @Juan no I gave up and installed anaconda – G Patel Dec 21 '20 at 23:41
  • 1
    I was facing the same error using Python 3.8 on MacOS 11.2. But as suggested by @Juan I updated my Python to 3.9 and this issue has resolved. – Prashant Kumar Mar 29 '21 at 13:14
  • [Please see another answer of mine for instructions](https://stackoverflow.com/a/70880741/315168) – Mikko Ohtamaa Jan 27 '22 at 14:58

1 Answers1

-3

I had the same issue when I was using Python installed via pyenv. It had some dependencies missing or the path was not successfully added.

So either you need to download all the dependencies and add them in your .profile file (either bash or zsh) which are not installed with the command:

pyenv install (version)

Or, you can try installing via HomeBrew which downloads all the dependencies/libraries and adds them to the default path required to run python programs successfully using the below command:

brew install python

Here is a nice link which you can follow for detailed instructions: https://docs.python-guide.org/starting/install3/osx/

And then I notice that you're using a virtual environment. I will advice to create a new virtual environment after the fresh installation is complete. (which is quite obvious I know) ;)

Hope this will resolve your issue with the missing libraries.

  • 1
    Hi Prashant, the command and link you provided are for python 3 installation. Why are you talking about installing the "missing dependencies" instead? – Yan Yang Aug 12 '21 at 08:28