I wanted to install the module xlwings, and one of its dependencies is appscript. So when I do:
pip3.6 install xlwings
I get the following error:
Collecting xlwings
Using cached https://files.pythonhosted.org/packages/f6/cf/c4e5ba995c6440fff3f6e846ba0aa92481d8d5c54c27860a324df525802b/xlwings-0.15.1.tar.gz
Requirement already satisfied: psutil>=2.0.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from xlwings) (5.4.8)
Collecting appscript>=1.0.1 (from xlwings)
Using cached https://files.pythonhosted.org/packages/35/0b/0ad06b376b2119c6c02a6d214070c8528081ed868bf82853d4758bf942eb/appscript-1.0.1.tar.gz
Installing collected packages: appscript, xlwings
Running setup.py install for appscript ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/4m/q2rj8ww90ms0jwg7zv4ldwqh0000gn/T/pip-install-t_le314z/appscript/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/4m/q2rj8ww90ms0jwg7zv4ldwqh0000gn/T/pip-record-7kas7ahn/install-record.txt --single-version-externally-managed --compile:
running install
Distribution option extra_path is deprecated. See issue27919 for details.
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
copying appscript_3x/lib/mactypes.py -> build/lib.macosx-10.6-intel-3.6
copying appscript_3x/lib/osax.py -> build/lib.macosx-10.6-intel-3.6
creating build/lib.macosx-10.6-intel-3.6/aem
copying appscript_3x/lib/aem/aemsend.py -> build/lib.macosx-10.6-intel-3.6/aem
copying appscript_3x/lib/aem/findapp.py -> build/lib.macosx-10.6-intel-3.6/aem
copying appscript_3x/lib/aem/aemconnect.py -> build/lib.macosx-10.6-intel-3.6/aem
copying appscript_3x/lib/aem/typewrappers.py -> build/lib.macosx-10.6-intel-3.6/aem
copying appscript_3x/lib/aem/__init__.py -> build/lib.macosx-10.6-intel-3.6/aem
copying appscript_3x/lib/aem/kae.py -> build/lib.macosx-10.6-intel-3.6/aem
copying appscript_3x/lib/aem/aemreference.py -> build/lib.macosx-10.6-intel-3.6/aem
copying appscript_3x/lib/aem/aemcodecs.py -> build/lib.macosx-10.6-intel-3.6/aem
copying appscript_3x/lib/aem/mactypes.py -> build/lib.macosx-10.6-intel-3.6/aem
creating build/lib.macosx-10.6-intel-3.6/appscript
copying appscript_3x/lib/appscript/keywordwrapper.py -> build/lib.macosx-10.6-intel-3.6/appscript
copying appscript_3x/lib/appscript/__init__.py -> build/lib.macosx-10.6-intel-3.6/appscript
copying appscript_3x/lib/appscript/referencerenderer.py -> build/lib.macosx-10.6-intel-3.6/appscript
copying appscript_3x/lib/appscript/terminologyparser.py -> build/lib.macosx-10.6-intel-3.6/appscript
copying appscript_3x/lib/appscript/reservedkeywords.py -> build/lib.macosx-10.6-intel-3.6/appscript
copying appscript_3x/lib/appscript/reference.py -> build/lib.macosx-10.6-intel-3.6/appscript
copying appscript_3x/lib/appscript/defaultterminology.py -> build/lib.macosx-10.6-intel-3.6/appscript
copying appscript_3x/lib/appscript/terminology.py -> build/lib.macosx-10.6-intel-3.6/appscript
copying appscript_3x/lib/appscript/genericreference.py -> build/lib.macosx-10.6-intel-3.6/appscript
running build_ext
building 'aem.ae' extension
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/appscript_3x
creating build/temp.macosx-10.6-intel-3.6/appscript_3x/ext
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c appscript_3x/ext/ae.c -o build/temp.macosx-10.6-intel-3.6/appscript_3x/ext/ae.o -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_4
In file included from appscript_3x/ext/ae.c:15:
In file included from appscript_3x/ext/ae.h:26:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:34:10: fatal error: 'CarbonSound/CarbonSound.h' file not found
#include <CarbonSound/CarbonSound.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/4m/q2rj8ww90ms0jwg7zv4ldwqh0000gn/T/pip-install-t_le314z/appscript/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/4m/q2rj8ww90ms0jwg7zv4ldwqh0000gn/T/pip-record-7kas7ahn/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/4m/q2rj8ww90ms0jwg7zv4ldwqh0000gn/T/pip-install-t_le314z/appscript/
I'm using Jupyter Notebook, and the notebook is running Python 3.6 so I want to specifically install appscript and xlwings on 3.6.
My OS is macOS Mojave 10.14.1.
The error code says the problem is with clang, so here is my clang version:
$clang --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Can anyone possibly shed some light please? ðŸ˜
Update:
the appscript package is now available as binary wheels from pypi. Simply do pip install appscript or pip install xlwings again.
Previous answer:
Make sure you have the XCode command line tools installed when installing with pip as pointed out on http://docs.xlwings.org/en/stable/installation.html#dependencies
If you want things to be easier, use the Anaconda distribution: It does not require the XCode command line tools.
Related
I am trying to install mysqlclient in Ubuntu, but the command returns error number 1.
I tried the command
sudo apt install default-libmysqlclient-dev
which worked. However
pip install mysqlclient
does not.
Can you please help me?
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-VZPWLf/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-VZPWLf/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-2_cjSE/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-VZPWLf/mysqlclient/
Complete output (31 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/MySQLdb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 -I/usr/include/mysql -I/usr/include/python2.7 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o
MySQLdb/_mysql.c:38:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-VZPWLf/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-VZPWLf/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-2_cjSE/install-record.txt --single-version-externally-managed --compile Check the logs for full command output
.
Looks like you haven't properly installed the header files and static libraries for python-dev. Use your package manager to install them system-wide.
For apt (Ubuntu, Debian...):
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
This worked for me on Ubuntu + Python 3.7
sudo apt install python3.7 python3-dev libmysqlclient-dev libpython3.7-dev
pip install mysqlclient
Reference
Rather, try this solution. I was using Ubuntu 18.04 and found this solution to be useful for python version 3.7.5
Step 1. Install libpython3.7-dev via sudo
> sudo apt-get install libpython3.7-dev
Step 2: Install latest mysqlclient via pip
> python3 -m pip install mysqlclient==1.4.6
I was going to use Django to develop my personal blog. I encountered this problem when configuring the environment:
~ » pip3 install mysqlclient hwangziqi#huangziqideMBP
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-bbsgdat8/mysqlclient/setup.py", line 16, in <module>
metadata, options = get_config()
File "/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-bbsgdat8/mysqlclient/setup_posix.py", line 53, in get_config
libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
File "/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-bbsgdat8/mysqlclient/setup_posix.py", line 53, in <listcomp>
libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
File "/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-bbsgdat8/mysqlclient/setup_posix.py", line 12, in dequote
raise Exception("Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?")
Exception: Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?
So, i tried https://bugs.mysql.com/bug.php?id=86971 .
$ mysql_config
Usage: /usr/local/bin/mysql_config [OPTIONS]
Options:
--cflags [-I/usr/local/Cellar/mysql-connector-c/6.1.10/include ]
--cxxflags [-I/usr/local/Cellar/mysql-connector-c/6.1.10/include ]
--include [-I/usr/local/Cellar/mysql-connector-c/6.1.10/include]
--libs [-L/usr/local/Cellar/mysql-connector-c/6.1.10/lib -l ]
--libs_r [-L/usr/local/Cellar/mysql-connector-c/6.1.10/lib -l ]
--plugindir [/usr/local/Cellar/mysql-connector-c/6.1.10/lib/plugin]
--socket [/tmp/mysql.sock]
--port [0]
--version [6.1.10]
--variable=VAR VAR is one of:
pkgincludedir [/usr/local/Cellar/mysql-connector-c/6.1.10/include]
pkglibdir [/usr/local/Cellar/mysql-connector-c/6.1.10/lib]
plugindir [/usr/local/Cellar/mysql-connector-c/6.1.10/lib/plugin]
`--libs` and `--libs_r` should have ` -lmysqlclient -lssl -lcrypto`, but it only have `-l`.
and now:
» pip3 install mysqlclient hwangziqi#huangziqideMBP
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-85s5jozc/mysqlclient/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/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-record-x9p5inkf/install-record.txt --single-version-externally-managed --compile:
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/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
creating build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/MySQLdb
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Dversion_info=(1,4,2,'post',1) -D__version__=1.4.2.post1 -I/usr/local/Cellar/mysql-connector-c/6.1.11/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.macosx-10.9-x86_64-3.7/MySQLdb/_mysql.o
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.7/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql-connector-c/6.1.11/lib -lssl -lcrypto -o build/lib.macosx-10.9-x86_64-3.7/MySQLdb/_mysql.cpython-37m-darwin.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-85s5jozc/mysqlclient/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/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-record-x9p5inkf/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-85s5jozc/mysqlclient/
i tried to reinstall openssl and mysql-connector-c by brew, but it was useless. My English is poor, I hope you can understand it. Thx so mush.
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
This question already has answers here:
TA-Lib Install Error
(3 answers)
Closed 4 years ago.
I've tried some alternatives but I can't install ta-lib or use make on my ubuntu ,when I send
pip install ta-Lib
Collecting ta-Lib
Using cached https://files.pythonhosted.org/packages/90/05/d4c6a778d7a7de0be366bc4a850b4ffaeac2abad927f95fa8ba6f355a082/TA-Lib-0.4.17.tar.gz
Requirement already satisfied: numpy in ./miniconda3/lib/python3.6/site-packages (from ta-Lib) (1.15.0)
Building wheels for collected packages: ta-Lib
Running setup.py bdist_wheel for ta-Lib ... error
Complete output from command /home/user/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ugk06wz4/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 /tmp/pip-wheel-v2gctt6z --python-tag cp36:
/tmp/pip-install-ugk06wz4/ta-Lib/setup.py:79: 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.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/talib
copying talib/stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/deprecated.py -> build/lib.linux-x86_64-3.6/talib
copying talib/abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_data.py -> build/lib.linux-x86_64-3.6/talib
copying talib/__init__.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_pandas.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_func.py -> build/lib.linux-x86_64-3.6/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/talib
gcc -pthread -B /home/user/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/user/miniconda3/lib/python3.6/site-packages/numpy/core/include -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/home/user/miniconda3/include/python3.6m -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.6/talib/_ta_lib.o
talib/_ta_lib.c:526:10: fatal error: ta-lib/ta_defs.h: No such file or directory
#include "ta-lib/ta_defs.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' 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 /home/user/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ugk06wz4/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 /tmp/pip-record-kipfzx36/install-record.txt --single-version-externally-managed --compile:
/tmp/pip-install-ugk06wz4/ta-Lib/setup.py:79: 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.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/talib
copying talib/stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/deprecated.py -> build/lib.linux-x86_64-3.6/talib
copying talib/abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_data.py -> build/lib.linux-x86_64-3.6/talib
copying talib/__init__.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_pandas.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_func.py -> build/lib.linux-x86_64-3.6/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/talib
gcc -pthread -B /home/user/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/user/miniconda3/lib/python3.6/site-packages/numpy/core/include -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/home/user/miniconda3/include/python3.6m -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.6/talib/_ta_lib.o
talib/_ta_lib.c:526:10: fatal error: ta-lib/ta_defs.h: No such file or directory
#include "ta-lib/ta_defs.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
and this in red at the end
Command
/home/user/miniconda3/bin/python -u -c "import setuptools,
tokenize;file='/tmp/pip-install-ugk06wz4/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 /tmp/pip-record-kipfzx36/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-ugk06wz4/ta-Lib/
when I type
make
or
sudo make install
I get this:
make: *** No rule to make target 'install'. Stop.
what am I doing wrong ?
Thanks in advance and thank you for your kindness
sudo pip install -U setuptools
Or if it doesn't work to quote his comment:
Try this 'sudo -H pip install TA-Lib'
I have installed tools via xcode-select --install but still show the following error while doing pip install MySQL-python
Building wheels for collected packages: MySQL-python
Running setup.py bdist_wheel for MySQL-python ... error
Complete output from command /Users/vaibhavmule/Envs/switchidea/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/p6/0v0bflxn3t399_qdpnm2z7hc0000gn/T/pip-install-SD9Cgh/MySQL-python/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/p6/0v0bflxn3t399_qdpnm2z7hc0000gn/T/pip-wheel-g6C50k --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.13-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.13-x86_64-2.7
creating build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
creating build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.13-x86_64-2.7
clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/Cellar/mysql/8.0.11/include/mysql -I/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.13-x86_64-2.7/_mysql.o
_mysql.c:36:10: fatal error: 'my_config.h' file not found
#include "my_config.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Failed building wheel for MySQL-python
Running setup.py clean for MySQL-python
Failed to build MySQL-python
django-model-utils 3.0.0 has requirement Django>=1.8, but you'll have django 1.6.7 which is incompatible.
faker 0.8.16 has requirement six>=1.10, but you'll have six 1.6.1 which is incompatible.
django-phonenumber-field 2.0.0 has requirement Django>=1.11, but you'll have django 1.6.7 which is incompatible.
Installing collected packages: MySQL-python, opbeat, olefile, Pillow, pyzmq, contextlib2, raven, simplejson, South, sqlparse, wheel, django-sendfile, httplib2, pytz, twilio, phonenumberslite, babel, django-phonenumber-field, django-twilio, text-unidecode, python-dateutil, Faker, factory-boy, waitress, beautifulsoup4, WebOb, webtest, django-webtest, coverage
Running setup.py install for MySQL-python ... error
Complete output from command /Users/vaibhavmule/Envs/switchidea/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/p6/0v0bflxn3t399_qdpnm2z7hc0000gn/T/pip-install-SD9Cgh/MySQL-python/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/p6/0v0bflxn3t399_qdpnm2z7hc0000gn/T/pip-record-ihy3we/install-record.txt --single-version-externally-managed --compile --install-headers /Users/vaibhavmule/Envs/switchidea/bin/../include/site/python2.7/MySQL-python:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.13-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.13-x86_64-2.7
creating build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb
creating build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.13-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.13-x86_64-2.7
clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/Cellar/mysql/8.0.11/include/mysql -I/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.13-x86_64-2.7/_mysql.o
_mysql.c:36:10: fatal error: 'my_config.h' file not found
#include "my_config.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/Users/vaibhavmule/Envs/switchidea/bin/python2.7 -u -c "import
setuptools, tokenize;__file__='/private/var/folders/p6/0v0bflxn3t399_qdpnm2z7hc0000gn/T/pip-install-SD9Cgh/MySQL-python/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/p6/0v0bflxn3t399_qdpnm2z7hc0000gn/T/pip-record-ihy3we/install-record.txt --single-version-externally-managed --compile --install-headers /Users/vaibhavmule/Envs/switchidea/bin/../include/site/python2.7/MySQL-python" failed with error code 1 in /private/var/folders/p6/0v0bflxn3t399_qdpnm2z7hc0000gn/T/pip-install-SD9Cgh/MySQL-python/
I just resolved this exact issue when running Ansible's mysql_user module. The answer here helped tip me off to a solution. I also needed MySQL-python from pip, which also broke in this process, so I've added the extra steps.
Steps to resolve:
brew unlink mysql # only if installed, causes the next step to fail
brew install mysql-connector-c
locate mysql_config file with which (mysql_config)
edit the mysql_config file, under # Create options change this:
libs="$libs -l "
to this:
libs="$libs -lmysqlclient -lssl -lcrypto"
if using vim, :wq! to save the read-only file
Now the install should run successfully
pip install mysqlclient
Adding this separately, as it's similar but not directly related to the initial question
pip install MySQL-python
Fix mysql brew formula, if it was unlinked in the first step.
brew unlink mysql-connector-c
brew link mysql
I fixed it by passing the OpenSSL path:
env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install mysqlclient
You can see the full article of the solution done by MrWeeble
I solved this issue by setting xcode-select to use non-XCode command line tools, as shown in the below answer. I had a related clang error which led me to this answer.
sudo xcode-select --switch /Library/Developer/CommandLineTools
https://stackoverflow.com/a/30902106/11614142
I know maybe the former answers can solve the problem already. But I'm still sharing below solution. If you don't want to brew install any extra things, you can try this solution.
I think the issue happens in many situations, mainly related to the installation of the pip packages about MySQL. In my case, I bumped into this issue when trying to install mysqlclient for Django.
This solution should work when you've installed MySQL with dmg downloaded from their official site.
In that case, you may find mysql_config in /usr/local/mysql/bin
If so, add export PATH="/usr/local/mysql/bin:${PATH}" in ~/.bash_profile, this would add the bin folder of mysql into the PATH, or you can say environment variable. Please note that mysql maybe in detail with your mysql version. In my case, the path is /usr/local/mysql-8.0.12-macos10.13-x86_64/bin.
Save and close the file, then source ~/.bash_profile to enable the change.
Try to install the pip package about MySQL again.
If still not working, a restart is preferred.
None of these answers are really needed in that length. As Vishal noted it is as easy as
brew install openssl
LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient
Then go back to install your pip install -r requirements.txt
So first what is clang? it is a "compiler frontend" for C, C++. What is a compiler frontend you may ask? See this answer for more details. You're trying to install a library (mysqlclient or apache-airflow[mysql] or any other) that requires some C++ dependency to be found but is not, hence the message that looks like:
#include "my_config.h"
^~~~~~~~~~~~~
The clang error messages are pretty verbose so you might miss the important information. What's important are those 3 lines:
ld: library not found for -lzstd
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
Find that first line before "command 'clang' failed", this will tell you what library was not found.
If the library was not found, it could be because it's not installed (hence all the brew install ... answers here) or because it's not found in the path (hence all the export LDFLAGS=... and export LIBRARY_PATH=... answers).
In my case, 2 librairies were not found but both were installed, so I solved it with:
export LDFLAGS="-L/usr/local/Cellar/openssl#1.1/1.1.1l/lib -L/usr/local/Cellar/zstd/1.5.0/lib"
pip install 'apache-airflow[mysql]'
This is not a direct answer to OP, but hopefully helpful in some way.
I tried this,
export ARCHFLAGS="-arch x86_64"
Then re-execute the installation command. It's resolved for me.
Following did the trick for me, Using mac.
brew install leveldb gmp pkg-config
After this just run
pip3 install MySQL-python