1

I am trying to install a python package using: pip install PyPortfolioOpt I get this long error message that has to do with ecos and cvxpy. I see that is a common error on Windows but I am using MacOS Anaconda. I was trying to import a package in Jupyter notebook and needed to install first so I used the above command in terminal. I am not really familiar with these issues so can someone please tell what I need to do so this error doesn't happen in the future? Thank you

Error Message:

  Using cached https://files.pythonhosted.org/packages/8f/f5/4571e069d4870ede26995e191f2ef341329f881d7086cebea504141c79a8/PyPortfolioOpt-1.2.3-py3-none-any.whl
Requirement already satisfied: numpy<2.0,>=1.12 in ./opt/anaconda3/lib/python3.7/site-packages (from PyPortfolioOpt) (1.17.2)
Collecting cvxpy<1.1,>=1.0 (from PyPortfolioOpt)
  Using cached https://files.pythonhosted.org/packages/d2/a2/31b8c02a1b722f3713a0ea24ef8484c7f51edb0a73d44a0504140d0a624a/cvxpy-1.0.31-cp37-cp37m-macosx_10_9_x86_64.whl
Requirement already satisfied: pandas>=0.19 in ./opt/anaconda3/lib/python3.7/site-packages (from PyPortfolioOpt) (0.25.1)
Requirement already satisfied: scipy<2.0,>=1.3 in ./opt/anaconda3/lib/python3.7/site-packages (from PyPortfolioOpt) (1.3.1)
Requirement already satisfied: ecos>=2 in ./opt/anaconda3/lib/python3.7/site-packages (from cvxpy<1.1,>=1.0->PyPortfolioOpt) (2.0.7.post1)
Requirement already satisfied: multiprocess in ./opt/anaconda3/lib/python3.7/site-packages (from cvxpy<1.1,>=1.0->PyPortfolioOpt) (0.70.9)
Requirement already satisfied: osqp>=0.4.1 in ./opt/anaconda3/lib/python3.7/site-packages (from cvxpy<1.1,>=1.0->PyPortfolioOpt) (0.6.1)
Collecting scs>=1.1.3 (from cvxpy<1.1,>=1.0->PyPortfolioOpt)
  Using cached https://files.pythonhosted.org/packages/1a/72/33be87cce255d4e9dbbfef547e9fd6ec7ee94d0d0910bb2b13badea3fbbe/scs-2.1.2.tar.gz
Requirement already satisfied: pytz>=2017.2 in ./opt/anaconda3/lib/python3.7/site-packages (from pandas>=0.19->PyPortfolioOpt) (2019.3)
Requirement already satisfied: python-dateutil>=2.6.1 in ./opt/anaconda3/lib/python3.7/site-packages (from pandas>=0.19->PyPortfolioOpt) (2.8.0)
Requirement already satisfied: dill>=0.3.1 in ./opt/anaconda3/lib/python3.7/site-packages (from multiprocess->cvxpy<1.1,>=1.0->PyPortfolioOpt) (0.3.1.1)
Requirement already satisfied: future in ./opt/anaconda3/lib/python3.7/site-packages (from osqp>=0.4.1->cvxpy<1.1,>=1.0->PyPortfolioOpt) (0.18.2)
Requirement already satisfied: six>=1.5 in ./opt/anaconda3/lib/python3.7/site-packages (from python-dateutil>=2.6.1->pandas>=0.19->PyPortfolioOpt) (1.12.0)
Building wheels for collected packages: scs
  Building wheel for scs (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/eruiz/opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/pr/41m2pfg121n_23rq8p87s_zc0000gn/T/pip-install-uqw4m7ec/scs/setup.py'"'"'; __file__='"'"'/private/var/folders/pr/41m2pfg121n_23rq8p87s_zc0000gn/T/pip-install-uqw4m7ec/scs/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/pr/41m2pfg121n_23rq8p87s_zc0000gn/T/pip-wheel-eoykktil --python-tag cp37
       cwd: /private/var/folders/pr/41m2pfg121n_23rq8p87s_zc0000gn/T/pip-install-uqw4m7ec/scs/
  Complete output (59 lines):
  Namespace(blas64=False, extraverbose=False, float32=False, gpu=False, int32=False, scs=False)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.7
  creating build/lib.macosx-10.9-x86_64-3.7/scs
  copying src/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/scs
  running build_ext
  blas_mkl_info:
      libraries = ['mkl_rt', 'pthread']
      library_dirs = ['/Users/eruiz/opt/anaconda3/lib']
      define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
      include_dirs = ['/Users/eruiz/opt/anaconda3/include']
  blas_opt_info:
      libraries = ['mkl_rt', 'pthread']
      library_dirs = ['/Users/eruiz/opt/anaconda3/lib']
      define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
      include_dirs = ['/Users/eruiz/opt/anaconda3/include']
  lapack_mkl_info:
      libraries = ['mkl_rt', 'pthread']
      library_dirs = ['/Users/eruiz/opt/anaconda3/lib']
      define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
      include_dirs = ['/Users/eruiz/opt/anaconda3/include']
  lapack_opt_info:
      libraries = ['mkl_rt', 'pthread']
      library_dirs = ['/Users/eruiz/opt/anaconda3/lib']
      define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
      include_dirs = ['/Users/eruiz/opt/anaconda3/include']
  {'libraries': ['mkl_rt', 'pthread'], 'library_dirs': ['/Users/eruiz/opt/anaconda3/lib'], 'define_macros': [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)], 'include_dirs': ['/Users/eruiz/opt/anaconda3/include']}
  {'libraries': ['mkl_rt', 'pthread'], 'library_dirs': ['/Users/eruiz/opt/anaconda3/lib'], 'define_macros': [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)], 'include_dirs': ['/Users/eruiz/opt/anaconda3/include']}
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  error: Command "gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/eruiz/opt/anaconda3/include -arch x86_64 -I/Users/eruiz/opt/anaconda3/include -arch x86_64 -DPYTHON -DCTRLC=1 -DDLONG=1 -DCOPYAMATRIX -DUSE_LAPACK -DSCIPY_MKL_H -DHAVE_CBLAS -DSCIPY_MKL_H -DHAVE_CBLAS -Iscs/include -Iscs/linsys -Iscs/linsys/cpu/direct/ -Iscs/linsys/external/amd -Iscs/linsys/external/dqlql -I/Users/eruiz/opt/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/Users/eruiz/opt/anaconda3/include -I/Users/eruiz/opt/anaconda3/include -I/Users/eruiz/opt/anaconda3/include/python3.7m -c scs/src/cones.c -o build/temp.macosx-10.9-x86_64-3.7/scs/src/cones.o -O3" failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for scs
  Running setup.py clean for scs
Failed to build scs
Installing collected packages: scs, cvxpy, PyPortfolioOpt
  Running setup.py install for scs ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/eruiz/opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/pr/41m2pfg121n_23rq8p87s_zc0000gn/T/pip-install-uqw4m7ec/scs/setup.py'"'"'; __file__='"'"'/private/var/folders/pr/41m2pfg121n_23rq8p87s_zc0000gn/T/pip-install-uqw4m7ec/scs/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/pr/41m2pfg121n_23rq8p87s_zc0000gn/T/pip-record-oszpdazd/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/pr/41m2pfg121n_23rq8p87s_zc0000gn/T/pip-install-uqw4m7ec/scs/
    Complete output (59 lines):
    Namespace(blas64=False, extraverbose=False, float32=False, gpu=False, int32=False, scs=False)
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/scs
    copying src/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/scs
    running build_ext
    blas_mkl_info:
        libraries = ['mkl_rt', 'pthread']
        library_dirs = ['/Users/eruiz/opt/anaconda3/lib']
        define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
        include_dirs = ['/Users/eruiz/opt/anaconda3/include']
    blas_opt_info:
        libraries = ['mkl_rt', 'pthread']
        library_dirs = ['/Users/eruiz/opt/anaconda3/lib']
        define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
        include_dirs = ['/Users/eruiz/opt/anaconda3/include']
    lapack_mkl_info:
        libraries = ['mkl_rt', 'pthread']
        library_dirs = ['/Users/eruiz/opt/anaconda3/lib']
        define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
        include_dirs = ['/Users/eruiz/opt/anaconda3/include']
    lapack_opt_info:
        libraries = ['mkl_rt', 'pthread']
        library_dirs = ['/Users/eruiz/opt/anaconda3/lib']
        define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
        include_dirs = ['/Users/eruiz/opt/anaconda3/include']
    {'libraries': ['mkl_rt', 'pthread'], 'library_dirs': ['/Users/eruiz/opt/anaconda3/lib'], 'define_macros': [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)], 'include_dirs': ['/Users/eruiz/opt/anaconda3/include']}
    {'libraries': ['mkl_rt', 'pthread'], 'library_dirs': ['/Users/eruiz/opt/anaconda3/lib'], 'define_macros': [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)], 'include_dirs': ['/Users/eruiz/opt/anaconda3/include']}
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    error: Command "gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/eruiz/opt/anaconda3/include -arch x86_64 -I/Users/eruiz/opt/anaconda3/include -arch x86_64 -DPYTHON -DCTRLC=1 -DDLONG=1 -DCOPYAMATRIX -DUSE_LAPACK -DSCIPY_MKL_H -DHAVE_CBLAS -DSCIPY_MKL_H -DHAVE_CBLAS -Iscs/include -Iscs/linsys -Iscs/linsys/cpu/direct/ -Iscs/linsys/external/amd -Iscs/linsys/external/dqlql -I/Users/eruiz/opt/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/Users/eruiz/opt/anaconda3/include -I/Users/eruiz/opt/anaconda3/include -I/Users/eruiz/opt/anaconda3/include/python3.7m -c src/scsmodule.c -o build/temp.macosx-10.9-x86_64-3.7/src/scsmodule.o -O3" failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/eruiz/opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/pr/41m2pfg121n_23rq8p87s_zc0000gn/T/pip-install-uqw4m7ec/scs/setup.py'"'"'; __file__='"'"'/private/var/folders/pr/41m2pfg121n_23rq8p87s_zc0000gn/T/pip-install-uqw4m7ec/scs/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/pr/41m2pfg121n_23rq8p87s_zc0000gn/T/pip-record-oszpdazd/install-record.txt --single-version-externally-managed --compile Check the logs for full command output. ```

eruiz
  • 59
  • 9
  • 1
    Please add the complete log. What you have added is the generic message printed on any error. – hoefling Jun 13 '20 at 16:43
  • 1
    Run `xcode-select --install`, wait for the installation to complete and rerun `pip install PyPortfolioOpt`. – hoefling Jun 13 '20 at 16:50
  • @hoefling It worked! Bless your soul! I am beyond thankful – eruiz Jun 13 '20 at 17:02
  • https://stackoverflow.com/search?q=%5Bpip%5D+xcrun%3A+error%3A+invalid+active+developer+path+missing+xcrun – phd Jun 13 '20 at 17:12

0 Answers0