install detectron2 package on Docker - python

I am using the python 3.7.9 version. The dectron2 is not installed properly.
command:
docker exec -it 1ee02b74a599 /bin/bash
root#1ee02b74a599:/app# pip install detectron2==0.2.1 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.4/index.html
the below issue occurred during the installation.
*Building wheels for collected packages: pycocotools
Building wheel for pycocotools (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nmjk8ssb/pycocotools/setup.py'"'"'; __file__='"'"'/tmp/pip-install-nmjk8ssb/pycocotools/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 /tmp/pip-wheel-x7z500uh
cwd: /tmp/pip-install-nmjk8ssb/pycocotools/
Complete output (21 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/pycocotools
copying pycocotools/mask.py -> build/lib.linux-x86_64-3.7/pycocotools
copying pycocotools/cocoeval.py -> build/lib.linux-x86_64-3.7/pycocotools
copying pycocotools/__init__.py -> build/lib.linux-x86_64-3.7/pycocotools
copying pycocotools/coco.py -> build/lib.linux-x86_64-3.7/pycocotools
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools/_mask.c
/opt/conda/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-nmjk8ssb/pycocotools/pycocotools/_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'pycocotools._mask' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/common
creating build/temp.linux-x86_64-3.7/pycocotools
gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/conda/lib/python3.7/site-packages/numpy/core/include -I./common -I/opt/conda/include/python3.7m -c ./common/maskApi.c -o build/temp.linux-x86_64-3.7/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pycocotools*

please check the python image that you use in your Dockerfile, maybe The reason you're seeing this error is that you're using the alpine or slim image which removes gcc to keep it as small as possible, then use the images like python:3.7 or ...

Related

Failed to install quadprog on Linux Mint 20

has anyone installed this quadprog lib on Python 3.8 and Linux Mint 20? I'm trying to install and the following error is appearing:
pip install quadprog
Collecting quadprog
Using cached quadprog-0.1.8.tar.gz (269 kB)
Requirement already satisfied: Cython in ./anaconda3/lib/python3.8/site-packages (from quadprog) (0.29.21)
Building wheels for collected packages: quadprog
Building wheel for quadprog (setup.py) ... [?25lerror
ERROR: Command errored out with exit status 1:
command: /home/hugosouza/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8o_4txn2/quadprog_089e8c8a9afa4563849d61ace43b3f03/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8o_4txn2/quadprog_089e8c8a9afa4563849d61ace43b3f03/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 /tmp/pip-wheel-r3kgatse
cwd: /tmp/pip-install-8o_4txn2/quadprog_089e8c8a9afa4563849d61ace43b3f03/
Complete output (12 lines):
running bdist_wheel
running build
running build_ext
skipping 'quadprog/quadprog.cpp' Cython extension (up-to-date)
building 'quadprog' extension
creating build
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/quadprog
gcc -pthread -B /home/hugosouza/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iquadprog -I/home/hugosouza/anaconda3/include/python3.8 -c quadprog/quadprog.cpp -o build/temp.linux-x86_64-3.8/quadprog/quadprog.o
gcc: fatal error: cannot execute ‘cc1plus’: execvp: Arquivo ou diretório não encontrado
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for quadprog
nning setup.py clean for quadprog
Failed to build quadprog
^C
ERROR: Operation cancelled by user
Note: you may need to restart the kernel to use updated packages.
You need to install g++ or build-essential (which will install g++)
apt-get install g++

Why does pyheif crash on python import?

When trying to import 'pyheif' in a python 3 program, I get this crash dump below.
Can anyone explain how to successfully import this package? I have tried multiple versions, made sure "wheel" was installed, etc., searched Stack and done other searches but have not found out how to resolve.
Thanks in advance!
Collecting pyheif
Using cached pyheif-0.5.1.tar.gz (17 kB)
Requirement already satisfied: cffi>=1.0.0 in /Users/user/venv/HEICToJPG/lib/python3.8/site-packages (from pyheif) (1.14.4)
Requirement already satisfied: pycparser in /Users/user/venv/HEICToJPG/lib/python3.8/site-packages (from cffi>=1.0.0->pyheif) (2.20)
Building wheels for collected packages: pyheif
Building wheel for pyheif (setup.py): started
Building wheel for pyheif (setup.py): finished with status 'error'
Running setup.py clean for pyheif
Failed to build pyheif
Installing collected packages: pyheif
Running setup.py install for pyheif: started
Running setup.py install for pyheif: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Users/user/venv/HEICToJPG/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"'; __file__='"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/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/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-wheel-8kzdauau
cwd: /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/
Complete output (27 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
creating build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/error.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/constants.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/reader.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/writer.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
creating build/lib.macosx-10.9-x86_64-3.8/pyheif/data
copying pyheif/data/version.txt -> build/lib.macosx-10.9-x86_64-3.8/pyheif/data
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
generating cffi module 'build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c'
creating build/temp.macosx-10.9-x86_64-3.8
building '_libheif_cffi' extension
creating build/temp.macosx-10.9-x86_64-3.8/build
creating build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/usr/local/include -I/usr/include -I/Users/user/venv/HEICToJPG/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c -o build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.o
build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c:570:15: fatal error: 'libheif/heif.h' file not found
#include "libheif/heif.h"
^~~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyheif
ERROR: Command errored out with exit status 1:
command: /Users/user/venv/HEICToJPG/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"'; __file__='"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/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/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-record-phe46c7r/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user/venv/HEICToJPG/include/site/python3.8/pyheif
cwd: /private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/
Complete output (27 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
creating build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/error.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/constants.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/reader.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
copying pyheif/writer.py -> build/lib.macosx-10.9-x86_64-3.8/pyheif
creating build/lib.macosx-10.9-x86_64-3.8/pyheif/data
copying pyheif/data/version.txt -> build/lib.macosx-10.9-x86_64-3.8/pyheif/data
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
generating cffi module 'build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c'
creating build/temp.macosx-10.9-x86_64-3.8
building '_libheif_cffi' extension
creating build/temp.macosx-10.9-x86_64-3.8/build
creating build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/usr/local/include -I/usr/include -I/Users/user/venv/HEICToJPG/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c -o build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.o
build/temp.macosx-10.9-x86_64-3.8/_libheif_cffi.c:570:15: fatal error: 'libheif/heif.h' file not found
#include "libheif/heif.h"
^~~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/user/venv/HEICToJPG/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/setup.py'"'"'; __file__='"'"'/private/var/folders/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-install-q3c_oaef/pyheif_88ea55c096834e3e8b4bbae48bc5e633/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/ts/yxklk_lj3f32_q1kkljflz5h0000gn/T/pip-record-phe46c7r/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user/venv/HEICToJPG/include/site/python3.8/pyheif Check the logs for full command output.
We need to know a bit more about your environment, like what type of machine do you have, are you using docker, if yes what type of docker image are you using, etc.
I will try to give you a generic answer and maybe we can discuss in detail your problem once you will be back.
Try to follow the commands as described in repo https://github.com/carsales/pyheif
brew install libffi libheif
In case that you are using docker then add the following packages into a RUN command
RUN apt-get install -y libffi-dev libheif-dev libde265-dev

Install OpenEXR for python failed

I'm trying to install OpenEXR.
Using :
MacOS 10.14.5
Python 3.6.5
Xcode Version 10.2.1
I tried
pip install openexr
but got the following error:
Collecting openexr
Using cached https://files.pythonhosted.org/packages/7c/c4/76bf884f59d3137847edf8b93aaf40f6257d8315d0064e8b1a606ad80b1b/OpenEXR-1.3.2.tar.gz
Building wheels for collected packages: openexr
Building wheel for openexr (setup.py) ... error
ERROR: Complete output from command /Users/silviojin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-0_bh3qoe/openexr/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/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-wheel-gq2luicr --python-tag cp36:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying Imath.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building 'OpenEXR' extension
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/silviojin/anaconda3/include -arch x86_64 -I/Users/silviojin/anaconda3/include -arch x86_64 -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR -I/opt/local/include/OpenEXR -I/Users/silviojin/anaconda3/include/python3.6m -c OpenEXR.cpp -o build/temp.macosx-10.7-x86_64-3.6/OpenEXR.o -g -DVERSION="1.3.2"
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from OpenEXR.cpp:36:
In file included from /usr/local/include/OpenEXR/ImathBox.h:65:
In file included from /usr/local/include/OpenEXR/ImathVec.h:46:
In file included from /usr/local/include/OpenEXR/ImathExc.h:47:
/usr/local/include/OpenEXR/IexBaseExc.h:49:10: fatal error: 'string' file not found
#include <string>
^~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for openexr
Running setup.py clean for openexr
Failed to build openexr
Installing collected packages: openexr
Running setup.py install for openexr ... error
ERROR: Complete output from command /Users/silviojin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-0_bh3qoe/openexr/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/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-record-82it1du_/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying Imath.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building 'OpenEXR' extension
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/silviojin/anaconda3/include -arch x86_64 -I/Users/silviojin/anaconda3/include -arch x86_64 -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR -I/opt/local/include/OpenEXR -I/Users/silviojin/anaconda3/include/python3.6m -c OpenEXR.cpp -o build/temp.macosx-10.7-x86_64-3.6/OpenEXR.o -g -DVERSION="1.3.2"
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from OpenEXR.cpp:36:
In file included from /usr/local/include/OpenEXR/ImathBox.h:65:
In file included from /usr/local/include/OpenEXR/ImathVec.h:46:
In file included from /usr/local/include/OpenEXR/ImathExc.h:47:
/usr/local/include/OpenEXR/IexBaseExc.h:49:10: fatal error: 'string' file not found
#include <string>
^~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/Users/silviojin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-0_bh3qoe/openexr/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/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-record-82it1du_/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-0_bh3qoe/openexr/
same applies if I try to install other packages like:
https://github.com/jamesbowman/openexrpython
or
pip install pyexr
Then I tried:
brew install openexr
and it installed without errors. But I can't be found when importing in python.
Anyone knows why and how to fix this?
Most installation guide recommend installing via pip but I get the error above. The problem seems that it can't find the stdlibc++?
For me it worked installing OpenEXR via brew first and then directly via git
brew install openexr
pip install git+https://github.com/jamesbowman/openexrpython.git
This solution worked for me:
Create pip env. Mainly, follow https://www.excamera.com/sphinx/articles-openexr.html
sudo port install openexr
Download source code from https://github.com/jamesbowman/openexrpython
cd openexrpython
sudo python setup.py install
cd ..
pip install ./openexrpython

Installing py3exiv2 on macOS issues

I would like to calibrate a camera lens, to do this, I am following the instructions here. According to the instrucitons, I need the python3-exiv2 dependency from here.
When I try to run this:
pip3 install py3exiv2
I get this:
Collecting py3exiv2
Using cached https://files.pythonhosted.org/packages/39/0d/e3a63593c620c4a2999809aa011aa6f190553b20fd6904f7a11946dde722/py3exiv2-0.6.1.tar.gz
Building wheels for collected packages: py3exiv2
Building wheel for py3exiv2 (setup.py) ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-install-zeuz9z_9/py3exiv2/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/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-wheel-1l2_8rw6 --python-tag cp37:
find: /usr//sbin/authserver: Permission denied
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/preview.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/iptc.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/metadata.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/xmp.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/exif.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/utils.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
running build_ext
building 'libexiv2python' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/exiv2wrapper.cpp -o build/temp.macosx-10.14-x86_64-3.7/src/exiv2wrapper.o -g
In file included from src/exiv2wrapper.cpp:27:
src/exiv2wrapper.hpp:35:10: fatal error: 'boost/python.hpp' file not found
#include "boost/python.hpp"
^~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Failed building wheel for py3exiv2
Running setup.py clean for py3exiv2
Failed to build py3exiv2
Installing collected packages: py3exiv2
Running setup.py install for py3exiv2 ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-install-zeuz9z_9/py3exiv2/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/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-record-mo9lifhv/install-record.txt --single-version-externally-managed --compile:
find: /usr//sbin/authserver: Permission denied
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/preview.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/iptc.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/metadata.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/xmp.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/exif.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
copying src/pyexiv2/utils.py -> build/lib.macosx-10.14-x86_64-3.7/pyexiv2
running build_ext
building 'libexiv2python' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/exiv2wrapper.cpp -o build/temp.macosx-10.14-x86_64-3.7/src/exiv2wrapper.o -g
In file included from src/exiv2wrapper.cpp:27:
src/exiv2wrapper.hpp:35:10: fatal error: 'boost/python.hpp' file not found
#include "boost/python.hpp"
^~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-install-zeuz9z_9/py3exiv2/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/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-record-mo9lifhv/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/mn/_vm4d7cx4gx2_l5hkjybzkfc0000gn/T/pip-install-zeuz9z_9/py3exiv2/
I do not know where to start with this output. Can anyone suggest what I can try at this point?
Running the following has not helped:
brew boost-python
The problem you are facing is because on MacOS new versions, the pip3 is not looking for the headers files in correct places. Check my answer here: https://answers.launchpad.net/py3exiv2/+question/700064
This is what fixed it for me:
To get around this problem do the following:
brew install boost-python3 gexiv2 pygobject3
After installing the dependencies, you'll face more errors. To get around those, set the corrext include and linker path and then install the module using pip.
export CPLUS_INCLUDE_PATH=/usr/local/Cellar/exiv2/0.27.5_1/include/:/usr/local/opt/libssh/include/:/usr/local/Cellar/boost/1.76.0/include/
export LDFLAGS="-L/usr/local/Cellar/boost-python3/1.76.0/lib -L/usr/local/Cellar/exiv2/0.27.5_1/lib"
pip install py3exiv2
or if you are using pipenv
CPLUS_INCLUDE_PATH=/usr/local/Cellar/exiv2/0.27.5_1/include/:/usr/local/opt/libssh/include/:/usr/local/Cellar/boost/1.76.0/include/ LDFLAGS="-L/usr/local/Cellar/boost-python3/1.76.0/lib -L/usr/local/Cellar/exiv2/0.27.5_1/lib" pipenv install

/usr/bin/clang command failing trying to pip install TA-lib on MacOS

I'm trying pip install TA-lib and getting this log:
> pip install TA-lib
Collecting TA-lib
Downloading TA-Lib-0.4.10.tar.gz (829kB)
100% |████████████████████████████████| 839kB 822kB/s
Building wheels for collected packages: TA-lib
Running setup.py bdist_wheel for TA-lib ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/pip-build-z2UL44/TA-lib/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 /var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/tmpSTzWMxpip-wheel- --python-tag cp27:
/private/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/pip-build-z2UL44/TA-lib/setup.py:77: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-2.7
creating build/lib.macosx-10.6-intel-2.7/talib
copying talib/__init__.py -> build/lib.macosx-10.6-intel-2.7/talib
copying talib/deprecated.py -> build/lib.macosx-10.6-intel-2.7/talib
copying talib/test_abstract.py -> build/lib.macosx-10.6-intel-2.7/talib
copying talib/test_data.py -> build/lib.macosx-10.6-intel-2.7/talib
copying talib/test_func.py -> build/lib.macosx-10.6-intel-2.7/talib
copying talib/test_stream.py -> build/lib.macosx-10.6-intel-2.7/talib
running build_ext
building 'talib.common' extension
creating build/temp.macosx-10.6-intel-2.7
creating build/temp.macosx-10.6-intel-2.7/talib
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c talib/common.c -o build/temp.macosx-10.6-intel-2.7/talib/common.o
talib/common.c:242:10: fatal error: 'ta-lib/ta_defs.h' file not found
#include "ta-lib/ta_defs.h"
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
> Failed building wheel for TA-lib Running setup.py clean for TA-lib
> Failed to build TA-lib Installing collected packages: TA-lib Running
> setup.py install for TA-lib ... error
> Complete output from command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
> -u -c "import setuptools, tokenize;__file__='/private/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/pip-build-z2UL44/TA-lib/setup.py';f=getattr(tokenize,
> 'open', open)(__file__);code=f.read().replace('\r\n',
> '\n');f.close();exec(compile(code, __file__, 'exec'))" install
> --record /var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/pip-lbZkZA-record/install-record.txt
> --single-version-externally-managed --compile:
> /private/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/pip-build-z2UL44/TA-lib/setup.py:77:
> UserWarning: Cannot find ta-lib library, installation may fail.
> warnings.warn('Cannot find ta-lib library, installation may fail.')
> running install
> running build
> running build_py
> creating build
> creating build/lib.macosx-10.6-intel-2.7
> creating build/lib.macosx-10.6-intel-2.7/talib
> copying talib/__init__.py -> build/lib.macosx-10.6-intel-2.7/talib
> copying talib/deprecated.py -> build/lib.macosx-10.6-intel-2.7/talib
> copying talib/test_abstract.py -> build/lib.macosx-10.6-intel-2.7/talib
> copying talib/test_data.py -> build/lib.macosx-10.6-intel-2.7/talib
> copying talib/test_func.py -> build/lib.macosx-10.6-intel-2.7/talib
> copying talib/test_stream.py -> build/lib.macosx-10.6-intel-2.7/talib
> running build_ext
> building 'talib.common' extension
> creating build/temp.macosx-10.6-intel-2.7
> creating build/temp.macosx-10.6-intel-2.7/talib
> /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
> -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include
> -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c talib/common.c -o build/temp.macosx-10.6-intel-2.7/talib/common.o
> talib/common.c:242:10: fatal error: 'ta-lib/ta_defs.h' file not found
> #include "ta-lib/ta_defs.h"
> ^
> 1 error generated.
> error: command '/usr/bin/clang' failed with exit status 1
>
> ---------------------------------------- Command "/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
> -u -c "import setuptools, tokenize;__file__='/private/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/pip-build-z2UL44/TA-lib/setup.py';f=getattr(tokenize,
> 'open', open)(__file__);code=f.read().replace('\r\n',
> '\n');f.close();exec(compile(code, __file__, 'exec'))" install
> --record /var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/pip-lbZkZA-record/install-record.txt
> --single-version-externally-managed --compile" failed with error code 1 in
> /private/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/pip-build-z2UL44/TA-lib/
I'm quite at noob at installing stuff.
There is some guidance here:
https://pypi.python.org/pypi/TA-Lib
but its for python3, and I have no experience in this kind of troubleshooting
Please try:
brew install ta-lib
pip install numpy
pip install TA-lib
source of information:
https://github.com/mrjbq7/ta-lib

Categories