0

when I do pip3 install imread I get the following error:

Collecting imread
  Using cached imread-0.7.4.tar.gz (151 kB)
Requirement already satisfied: numpy in ./Library/Python/3.7/lib/python/site-packages (from imread) (1.17.4)
Building wheels for collected packages: imread
  Building wheel for imread (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xt/0v5vcz0s2dg46z8x7j6c4yf80000gn/T/pip-install-yzh0j2tc/imread/setup.py'"'"'; __file__='"'"'/private/var/folders/xt/0v5vcz0s2dg46z8x7j6c4yf80000gn/T/pip-install-yzh0j2tc/imread/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/xt/0v5vcz0s2dg46z8x7j6c4yf80000gn/T/pip-wheel-th30_vsf
       cwd: /private/var/folders/xt/0v5vcz0s2dg46z8x7j6c4yf80000gn/T/pip-install-yzh0j2tc/imread/
  Complete output (125 lines):
  sh: pkg-config: command not found
  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/imread
  copying imread/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/imread
  copying imread/imread_version.py -> build/lib.macosx-10.9-x86_64-3.7/imread
  copying imread/ijrois.py -> build/lib.macosx-10.9-x86_64-3.7/imread
  copying imread/special.py -> build/lib.macosx-10.9-x86_64-3.7/imread
  copying imread/imread.py -> build/lib.macosx-10.9-x86_64-3.7/imread
  creating build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_tiff.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_rois.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_webp.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_jpeg.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_imread_from_blob.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_imread.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_xcf.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_formats.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_imsave.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_error.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_bad.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_png.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  copying imread/tests/test_bmp.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
  creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/good.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/bit1.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/1_webp_a.webp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/rois.zip -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/rgba.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/ghsystem_flame.jpg -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/star1.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/stack.tiff -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/T -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/0186-0099.roi -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/error.unknown -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/error.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/error.jpg -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/good -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/arange512_16bit.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/diag.xcf -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/palette_zero.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/py-installer-indexed.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/mono.tif -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/error.tif -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  copying imread/tests/data/error.webp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
  creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files
  creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/TIFF
  copying imread/tests/data/bad-files/TIFF/00r00.tiff -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/TIFF
  creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP
  creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
  copying imread/tests/data/bad-files/BMP/00r/00r05.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
  copying imread/tests/data/bad-files/BMP/00r/00r04.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
  copying imread/tests/data/bad-files/BMP/00r/00r06.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
  copying imread/tests/data/bad-files/BMP/00r/00r03.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
  copying imread/tests/data/bad-files/BMP/00r/00r02.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
  copying imread/tests/data/bad-files/BMP/00r/00r00.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
  copying imread/tests/data/bad-files/BMP/00r/00r01.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
  creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM
  creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/00r
  copying imread/tests/data/bad-files/LSM/00r/00r03.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/00r
  copying imread/tests/data/bad-files/LSM/00r/00r02.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/00r
  copying imread/tests/data/bad-files/LSM/00r/00r00.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/00r
  copying imread/tests/data/bad-files/LSM/00r/00r01.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/00r
  creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/02r
  copying imread/tests/data/bad-files/LSM/02r/02r00.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/02r
  copying imread/tests/data/bad-files/LSM/02r/02r01.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/02r
  copying imread/tests/data/bad-files/LSM/02r/02r02.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/02r
  creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/01r
  copying imread/tests/data/bad-files/LSM/01r/01r01.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/01r
  copying imread/tests/data/bad-files/LSM/01r/01r00.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/01r
  copying imread/tests/data/bad-files/LSM/01r/01r02.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/01r
  creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/03w
  copying imread/tests/data/bad-files/LSM/03w/03w03.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/03w
  copying imread/tests/data/bad-files/LSM/03w/03w02.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/03w
  copying imread/tests/data/bad-files/LSM/03w/03w00.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/03w
  copying imread/tests/data/bad-files/LSM/03w/03w01.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/03w
  running build_ext
  building 'imread._imread' extension
  creating build/temp.macosx-10.9-x86_64-3.7
  creating build/temp.macosx-10.9-x86_64-3.7/imread
  creating build/temp.macosx-10.9-x86_64-3.7/imread/lib
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/Users/matinsaurralde/Library/Python/3.7/lib/python/site-packages/numpy/core/include -c imread/_imread.cpp -o build/temp.macosx-10.9-x86_64-3.7/imread/_imread.o -stdlib=libc++
  In file included from imread/_imread.cpp:20:
  imread/lib/base.h:138:46: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
          void push_back(std::unique_ptr<Image>&& p) { content.push_back(p.release()); }
                                               ^
  1 warning generated.
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/Users/matinsaurralde/Library/Python/3.7/lib/python/site-packages/numpy/core/include -c imread/lib/formats.cpp -o build/temp.macosx-10.9-x86_64-3.7/imread/lib/formats.o -stdlib=libc++
  In file included from imread/lib/formats.cpp:4:
  In file included from imread/lib/formats.h:6:
  imread/lib/base.h:138:46: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
          void push_back(std::unique_ptr<Image>&& p) { content.push_back(p.release()); }
                                               ^
  In file included from imread/lib/formats.cpp:9:
  imread/lib/_tiff.h:41:37: warning: 'STKFormat::read_multi' hides overloaded virtual function [-Woverloaded-virtual]
          std::unique_ptr<image_list> read_multi(byte_source* s, ImageFactory* f);
                                      ^
  imread/lib/base.h:239:45: note: hidden overloaded virtual function 'ImageFormat::read_multi' declared here: different number of parameters (3 vs 2)
          virtual std::unique_ptr<image_list> read_multi(byte_source* src, ImageFactory* factory, const options_map&) {
                                              ^
  2 warnings generated.
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/Users/matinsaurralde/Library/Python/3.7/lib/python/site-packages/numpy/core/include -c imread/lib/numpy.cpp -o build/temp.macosx-10.9-x86_64-3.7/imread/lib/numpy.o -stdlib=libc++
  In file included from imread/lib/numpy.cpp:4:
  In file included from imread/lib/numpy.h:8:
  imread/lib/base.h:138:46: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
          void push_back(std::unique_ptr<Image>&& p) { content.push_back(p.release()); }
                                               ^
  1 warning generated.
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/Users/matinsaurralde/Library/Python/3.7/lib/python/site-packages/numpy/core/include -c imread/lib/_bmp.cpp -o build/temp.macosx-10.9-x86_64-3.7/imread/lib/_bmp.o -stdlib=libc++
  In file included from imread/lib/_bmp.cpp:5:
  imread/lib/base.h:138:46: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
          void push_back(std::unique_ptr<Image>&& p) { content.push_back(p.release()); }
                                               ^
  imread/lib/_bmp.cpp:108:12: error: calling a private constructor of class 'std::__1::unique_ptr<Image, std::__1::default_delete<Image> >'
      return output;
             ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2535:3: note: declared private here
    unique_ptr(unique_ptr&);
    ^
  1 warning and 1 error generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for imread
  Running setup.py clean for imread
Failed to build imread
Installing collected packages: imread
    Running setup.py install for imread ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xt/0v5vcz0s2dg46z8x7j6c4yf80000gn/T/pip-install-yzh0j2tc/imread/setup.py'"'"'; __file__='"'"'/private/var/folders/xt/0v5vcz0s2dg46z8x7j6c4yf80000gn/T/pip-install-yzh0j2tc/imread/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/xt/0v5vcz0s2dg46z8x7j6c4yf80000gn/T/pip-record-7oz3j6hu/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/imread
         cwd: /private/var/folders/xt/0v5vcz0s2dg46z8x7j6c4yf80000gn/T/pip-install-yzh0j2tc/imread/
    Complete output (125 lines):
    sh: pkg-config: command not found
    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/imread
    copying imread/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/imread
    copying imread/imread_version.py -> build/lib.macosx-10.9-x86_64-3.7/imread
    copying imread/ijrois.py -> build/lib.macosx-10.9-x86_64-3.7/imread
    copying imread/special.py -> build/lib.macosx-10.9-x86_64-3.7/imread
    copying imread/imread.py -> build/lib.macosx-10.9-x86_64-3.7/imread
    creating build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_tiff.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_rois.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_webp.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_jpeg.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_imread_from_blob.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_imread.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_xcf.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_formats.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_imsave.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_error.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_bad.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_png.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    copying imread/tests/test_bmp.py -> build/lib.macosx-10.9-x86_64-3.7/imread/tests
    creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/good.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/bit1.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/1_webp_a.webp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/rois.zip -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/rgba.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/ghsystem_flame.jpg -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/star1.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/stack.tiff -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/T -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/0186-0099.roi -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/error.unknown -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/error.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/error.jpg -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/good -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/arange512_16bit.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/diag.xcf -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/palette_zero.png -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/py-installer-indexed.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/mono.tif -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/error.tif -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    copying imread/tests/data/error.webp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data
    creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files
    creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/TIFF
    copying imread/tests/data/bad-files/TIFF/00r00.tiff -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/TIFF
    creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP
    creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
    copying imread/tests/data/bad-files/BMP/00r/00r05.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
    copying imread/tests/data/bad-files/BMP/00r/00r04.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
    copying imread/tests/data/bad-files/BMP/00r/00r06.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
    copying imread/tests/data/bad-files/BMP/00r/00r03.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
    copying imread/tests/data/bad-files/BMP/00r/00r02.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
    copying imread/tests/data/bad-files/BMP/00r/00r00.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
    copying imread/tests/data/bad-files/BMP/00r/00r01.bmp -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/BMP/00r
    creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM
    creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/00r
    copying imread/tests/data/bad-files/LSM/00r/00r03.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/00r
    copying imread/tests/data/bad-files/LSM/00r/00r02.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/00r
    copying imread/tests/data/bad-files/LSM/00r/00r00.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/00r
    copying imread/tests/data/bad-files/LSM/00r/00r01.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/00r
    creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/02r
    copying imread/tests/data/bad-files/LSM/02r/02r00.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/02r
    copying imread/tests/data/bad-files/LSM/02r/02r01.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/02r
    copying imread/tests/data/bad-files/LSM/02r/02r02.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/02r
    creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/01r
    copying imread/tests/data/bad-files/LSM/01r/01r01.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/01r
    copying imread/tests/data/bad-files/LSM/01r/01r00.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/01r
    copying imread/tests/data/bad-files/LSM/01r/01r02.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/01r
    creating build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/03w
    copying imread/tests/data/bad-files/LSM/03w/03w03.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/03w
    copying imread/tests/data/bad-files/LSM/03w/03w02.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/03w
    copying imread/tests/data/bad-files/LSM/03w/03w00.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/03w
    copying imread/tests/data/bad-files/LSM/03w/03w01.lsm -> build/lib.macosx-10.9-x86_64-3.7/imread/tests/data/bad-files/LSM/03w
    running build_ext
    building 'imread._imread' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    creating build/temp.macosx-10.9-x86_64-3.7/imread
    creating build/temp.macosx-10.9-x86_64-3.7/imread/lib
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/Users/matinsaurralde/Library/Python/3.7/lib/python/site-packages/numpy/core/include -c imread/_imread.cpp -o build/temp.macosx-10.9-x86_64-3.7/imread/_imread.o -stdlib=libc++
    In file included from imread/_imread.cpp:20:
    imread/lib/base.h:138:46: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
            void push_back(std::unique_ptr<Image>&& p) { content.push_back(p.release()); }
                                                 ^
    1 warning generated.
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/Users/matinsaurralde/Library/Python/3.7/lib/python/site-packages/numpy/core/include -c imread/lib/formats.cpp -o build/temp.macosx-10.9-x86_64-3.7/imread/lib/formats.o -stdlib=libc++
    In file included from imread/lib/formats.cpp:4:
    In file included from imread/lib/formats.h:6:
    imread/lib/base.h:138:46: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
            void push_back(std::unique_ptr<Image>&& p) { content.push_back(p.release()); }
                                                 ^
    In file included from imread/lib/formats.cpp:9:
    imread/lib/_tiff.h:41:37: warning: 'STKFormat::read_multi' hides overloaded virtual function [-Woverloaded-virtual]
            std::unique_ptr<image_list> read_multi(byte_source* s, ImageFactory* f);
                                        ^
    imread/lib/base.h:239:45: note: hidden overloaded virtual function 'ImageFormat::read_multi' declared here: different number of parameters (3 vs 2)
            virtual std::unique_ptr<image_list> read_multi(byte_source* src, ImageFactory* factory, const options_map&) {
                                                ^
    2 warnings generated.
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/Users/matinsaurralde/Library/Python/3.7/lib/python/site-packages/numpy/core/include -c imread/lib/numpy.cpp -o build/temp.macosx-10.9-x86_64-3.7/imread/lib/numpy.o -stdlib=libc++
    In file included from imread/lib/numpy.cpp:4:
    In file included from imread/lib/numpy.h:8:
    imread/lib/base.h:138:46: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
            void push_back(std::unique_ptr<Image>&& p) { content.push_back(p.release()); }
                                                 ^
    1 warning generated.
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=MahotasImread_PyArray_API_Symbol -DIMREAD_EXCLUDE_WEBP=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/Users/matinsaurralde/Library/Python/3.7/lib/python/site-packages/numpy/core/include -c imread/lib/_bmp.cpp -o build/temp.macosx-10.9-x86_64-3.7/imread/lib/_bmp.o -stdlib=libc++
    In file included from imread/lib/_bmp.cpp:5:
    imread/lib/base.h:138:46: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
            void push_back(std::unique_ptr<Image>&& p) { content.push_back(p.release()); }
                                                 ^
    imread/lib/_bmp.cpp:108:12: error: calling a private constructor of class 'std::__1::unique_ptr<Image, std::__1::default_delete<Image> >'
        return output;
               ^
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:2535:3: note: declared private here
      unique_ptr(unique_ptr&);
      ^
    1 warning and 1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xt/0v5vcz0s2dg46z8x7j6c4yf80000gn/T/pip-install-yzh0j2tc/imread/setup.py'"'"'; __file__='"'"'/private/var/folders/xt/0v5vcz0s2dg46z8x7j6c4yf80000gn/T/pip-install-yzh0j2tc/imread/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/xt/0v5vcz0s2dg46z8x7j6c4yf80000gn/T/pip-record-7oz3j6hu/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/imread Check the logs for full command output.

I already tried with pip3 install imread --no-cache-dir as I read somewhere else but didn't work at all. I already did brew install gcc but it didn't work out. I deleted and reinstalled the command line tools through terminal with xcode-select --install but still doesn't work.

I can read in the first lines that it says "Requirement already satisfied" but I checked and imread is definitely not installed.

Environment:

  • macOS Catalina 10.15.4

  • python 3.7.7 (I tried installing it in python 2.7 using just pip but still doesn't work).

  • pip version = pip 20.1 from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)

if anyone can find the solution I would be very grateful! I've been looking for hours for the solution and I can't find it!

TheSola10
  • 697
  • 6
  • 16

2 Answers2

1

You need to install pkg-config package. For MacOSX you may find it either in Brew or in other software collections like thus sourceforge repository

The second (and perhaps the actual) error is the error with gcc. Considering the line

 imread/lib/base.h:138:46: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      void push_back(std::unique_ptr<Image>&& p) { content.push_back(p.release()); }

I expect your gcc being quite old. What is its actual version? Try to run gcc -v to find out.

Update:

As a non-Mac user I would go with gcc :-) . To install gcc-9+ from brew, use brew install gcc command. Then check that gcc and g++ are actually installed:

g++-9 --version

I would also check the C++ standard library as suggested in https://stackoverflow.com/a/17940219/3159253 :

`gcc-9 -print-prog-name=cc1plus` -v

Make sure the paths point to relatively recent version of C++ library, not to 4.2.1 as in your comment.

You should then explicitly use it when running pip:

CC=gcc-9 pip install imread
user3159253
  • 16,836
  • 3
  • 30
  • 56
  • I did gcc -v and the output was: Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 11.0.3 (clang-1103.0.32.59) Target: x86_64-apple-darwin19.4.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin – Matías Insaurralde Apr 30 '20 at 04:27
  • 1
    Ouch. It seems it uses *quite* outdated `libstdc++` headers (`-with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1`). Probably you have no other option than to update the toolchain – user3159253 Apr 30 '20 at 04:31
  • Thank you! The truth is that I am very new to the environment and I don't know much about these tools, you would help me a lot by telling me how to update that! – Matías Insaurralde Apr 30 '20 at 04:37
  • I already had gcc installed via brew but I reinstalled it anyways. 'g++-9 --version' returns 'g++-9 (Homebrew GCC 9.3.0_1) 9.3.0'. The paths point to relatively recent version of C++ library, not to 4.2.1. 'CC=gcc-9 pip install imread' gives me an error of 'gcc-9: error: unrecognized command line option '-stdlib=libc++' error: command 'gcc-9' failed with exit status 1'. Cant install it :( – Matías Insaurralde May 07 '20 at 22:11
  • Looks like `pip` on MacOSX is hardcoded to be clang-only. See this: https://stackoverflow.com/questions/34654682/unrecognized-command-line-option-stdlib-libc-gcc-homebrew-gcc-5-3-0-5-3-0 . Then it seems that the only only "proper" way is to update clang compiler. Alternatively you could find where the Python PIP machinery forms the command line for a C++ compiler and remove the `-stdlib=...` part, but I would try to stay with the defaults. You should try to update clang shipped with Xcode tools, or https://embeddedartistry.com/blog/2017/02/24/installing-llvm-clang-on-osx/ – user3159253 May 08 '20 at 02:39
1

It says quite clearly:

sh: pkg-config: command not found

So you have to install pkg-config and try again.

lenik
  • 23,228
  • 4
  • 34
  • 43