I'm trying to get install TA-lib, but running into errors I don't understand.
I installed brew, and ran the following:
brew install ta-lib
That seemed to work because if I re-run that, I get a note that
ta-lib 0.4.0 is already installed and up-to-date
However, running pip3 install ta-lib results in the following errors. From googling around, this seems to happen when ta-lib wasn't installed first, but not sure how to address when the initial install seems to go fine.
pip3 install TA-lib
Collecting TA-lib
Using cached TA-Lib-0.4.19.tar.gz (267 kB)
Requirement already satisfied: numpy in /Users/mf/venv/lib/python3.8/site-packages (from TA-lib) (1.19.5)
Using legacy 'setup.py install' for TA-lib, since package 'wheel' is not installed.
Installing collected packages: TA-lib
Running setup.py install for TA-lib ... error
ERROR: Command errored out with exit status 1:
command: /Users/mf/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/setup.py'"'"'; __file__='"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/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/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-record-q2zdmts7/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mf/venv/include/site/python3.8/TA-lib
cwd: /private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/
Complete output (27 lines):
/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/setup.py:71: 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.14.6-x86_64-3.8
creating build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/abstract.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_abstract.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/deprecated.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/stream.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_pandas.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_data.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_func.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_stream.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.macosx-10.14.6-x86_64-3.8
creating build/temp.macosx-10.14.6-x86_64-3.8/talib
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/Users/mf/venv/lib/python3.8/site-packages/numpy/core/include -I/Users/mf/venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c talib/_ta_lib.c -o build/temp.macosx-10.14.6-x86_64-3.8/talib/_ta_lib.o
talib/_ta_lib.c:611:10: fatal error: 'ta-lib/ta_defs.h' file not found
#include "ta-lib/ta_defs.h"
^~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/mf/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/setup.py'"'"'; __file__='"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/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/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-record-q2zdmts7/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mf/venv/include/site/python3.8/TA-lib Check the logs for full command output.
I updated TA_LIBRARY_PATH & TA_INCLUDE_PATH after finding where brew was installing ta-lib, ran the following and pip3 install seemed to work properly, but I wasn't able to actually import it. After trying to re-install ta-lib, I get the same error as above.
export TA_LIBRARY_PATH=/opt/homebrew/opt/ta-lib/lib
export TA_INCLUDE_PATH=/opt/homebrew/opt/ta-lib/include
Related
I am trying to get postgresql up and running on my computer to use with python3. From what I understand, I have to download postgresql and then psycopg2. I used the command
brew install postgresql
which worked without any error. I then proceeded to do
pip3 install psycopg2
but got the error
ERROR: Could not find a version that satisfies the requirement pyscopg2 (from versions: none)
ERROR: No matching distribution found for pyscopg2
I know that psycopg2-binary exists, but I would rather not install it unless I have to.
EDIT:
Turns out as wu.guan.feng.yue pointed out, I had a typo (fixed now). Unfortunately, I just got another error.
Collecting psycopg2
Using cached psycopg2-2.9.1.tar.gz (379 kB)
Using legacy 'setup.py install' for psycopg2, since package 'wheel' is not installed.
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zb/6bvbfsfn6fqdl6wzjp52ykj80000gn/T/pip-install-w901ehls/psycopg2_8dfb1124ccd54b17b1211b191de99482/setup.py'"'"'; __file__='"'"'/private/var/folders/zb/6bvbfsfn6fqdl6wzjp52ykj80000gn/T/pip-install-w901ehls/psycopg2_8dfb1124ccd54b17b1211b191de99482/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/zb/6bvbfsfn6fqdl6wzjp52ykj80000gn/T/pip-record-x11loqj9/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/psycopg2
cwd: /private/var/folders/zb/6bvbfsfn6fqdl6wzjp52ykj80000gn/T/pip-install-w901ehls/psycopg2_8dfb1124ccd54b17b1211b191de99482/
Complete output (34 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.9
creating build/lib.macosx-10.9-x86_64-3.9/psycopg2
copying lib/_json.py -> build/lib.macosx-10.9-x86_64-3.9/psycopg2
copying lib/extras.py -> build/lib.macosx-10.9-x86_64-3.9/psycopg2
copying lib/errorcodes.py -> build/lib.macosx-10.9-x86_64-3.9/psycopg2
copying lib/tz.py -> build/lib.macosx-10.9-x86_64-3.9/psycopg2
copying lib/_range.py -> build/lib.macosx-10.9-x86_64-3.9/psycopg2
copying lib/_ipaddress.py -> build/lib.macosx-10.9-x86_64-3.9/psycopg2
copying lib/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/psycopg2
copying lib/extensions.py -> build/lib.macosx-10.9-x86_64-3.9/psycopg2
copying lib/errors.py -> build/lib.macosx-10.9-x86_64-3.9/psycopg2
copying lib/sql.py -> build/lib.macosx-10.9-x86_64-3.9/psycopg2
copying lib/pool.py -> build/lib.macosx-10.9-x86_64-3.9/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.macosx-10.9-x86_64-3.9
creating build/temp.macosx-10.9-x86_64-3.9/psycopg
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.9.1 (dt dec pq3 ext lo64) -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=130003 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -I/usr/local/Cellar/icu4c/69.1/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/readline/include -c psycopg/adapter_asis.c -o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_asis.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zb/6bvbfsfn6fqdl6wzjp52ykj80000gn/T/pip-install-w901ehls/psycopg2_8dfb1124ccd54b17b1211b191de99482/setup.py'"'"'; __file__='"'"'/private/var/folders/zb/6bvbfsfn6fqdl6wzjp52ykj80000gn/T/pip-install-w901ehls/psycopg2_8dfb1124ccd54b17b1211b191de99482/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/zb/6bvbfsfn6fqdl6wzjp52ykj80000gn/T/pip-record-x11loqj9/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/psycopg2 Check the logs for full command output.
You might have a typo "pscyopg2". Do you mean by pip3 install psycopg2?
Alright, I found the answer. I noticed one line of the error said
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
I looked it up finding this question: Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools).
Turned out the problem was that I needed to run the command
xcode-select --install
in order to update the Xcode Command-line Tools.
Using macOS 10.15.6, I have installed python3 (3.8.5) through homebrew (2.4.9). Then I have installed the packages I needed using pip3 (20.2).
But I am having an issue when I want to install a python module called "batman".
I first installed it using pip3 install batman, but then I saw that the correct way was to do pip3 install batman-package, except that doing so gives me a long error message that I tried to understand, however I have not managed to understand what I needed to fix, so I am asking if anyone has a way to fix this?
Thanks
Collecting batman-package
Using cached batman-package-2.4.6.tar.gz (29 kB)
Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (from batman-package) (1.19.0)
Building wheels for collected packages: batman-package
Building wheel for batman-package (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python#3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"'; __file__='"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/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/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-wheel-9fvrwe2s
cwd: /private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/
Complete output (25 lines):
Checking for OpenMP support...
Did not detect OpenMP support.
/usr/local/Cellar/python#3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extras_requires'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.15-x86_64-3.8
creating build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/openmp.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/transitmodel.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/plots.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/tests.py -> build/lib.macosx-10.15-x86_64-3.8/batman
running build_ext
building 'batman._nonlinear_ld' extension
creating build/temp.macosx-10.15-x86_64-3.8
creating build/temp.macosx-10.15-x86_64-3.8/c_src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python#3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c c_src/_nonlinear_ld.c -o build/temp.macosx-10.15-x86_64-3.8/c_src/_nonlinear_ld.o -std=c99
c_src/_nonlinear_ld.c:21:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for batman-package
Running setup.py clean for batman-package
Failed to build batman-package
DEPRECATION: Could not build wheels for batman-package which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: batman-package
Running setup.py install for batman-package ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python#3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"'; __file__='"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/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/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-record-a9qct8l8/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/batman-package
cwd: /private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/
Complete output (25 lines):
Checking for OpenMP support...
Did not detect OpenMP support.
/usr/local/Cellar/python#3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extras_requires'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.macosx-10.15-x86_64-3.8
creating build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/openmp.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/transitmodel.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/plots.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/tests.py -> build/lib.macosx-10.15-x86_64-3.8/batman
running build_ext
building 'batman._nonlinear_ld' extension
creating build/temp.macosx-10.15-x86_64-3.8
creating build/temp.macosx-10.15-x86_64-3.8/c_src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python#3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c c_src/_nonlinear_ld.c -o build/temp.macosx-10.15-x86_64-3.8/c_src/_nonlinear_ld.o -std=c99
c_src/_nonlinear_ld.c:21:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python#3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"'; __file__='"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/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/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-record-a9qct8l8/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/batman-package Check the logs for full command output.
Ok so it was actually a problem with headers as thilina lakshan said. I followed the link he posted and indeed by running export CFLAGS="-I /usr/local/lib/python3.8/site-packages/numpy/core/include $CFLAGS" in the terminal worked and I could install the package.
Thank you very very much!
How could install mysql-python in python 3 using MacOS?
I tried this too:
$ brew install mysql
$ pip install mysqlclient
and it returned me the following error:
Collecting mysqlclient
Using cached mysqlclient-1.4.6.tar.gz (85 kB)
Could not build wheels for mysqlclient, since package 'wheel' is not installed.
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... 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/kz/hw6d2_6j2xbgr4vs3c38zm040000gn/T/pip-install-_pr7g788/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/kz/hw6d2_6j2xbgr4vs3c38zm040000gn/T/pip-install-_pr7g788/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/kz/hw6d2_6j2xbgr4vs3c38zm040000gn/T/pip-record-caw5qeb2/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/mysqlclient
cwd: /private/var/folders/kz/hw6d2_6j2xbgr4vs3c38zm040000gn/T/pip-install-_pr7g788/mysqlclient/
Complete output (30 lines):
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,6,'final',0) -D__version__=1.4.6 -I/usr/local/Cellar/mysql/8.0.19/include/mysql -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/8.0.19/lib -lmysqlclient -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
----------------------------------------
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/kz/hw6d2_6j2xbgr4vs3c38zm040000gn/T/pip-install-_pr7g788/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/kz/hw6d2_6j2xbgr4vs3c38zm040000gn/T/pip-install-_pr7g788/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/kz/hw6d2_6j2xbgr4vs3c38zm040000gn/T/pip-record-caw5qeb2/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/mysqlclient Check the logs for full command output.
the next try I use pip instaed of brew, but keep returning error.
$ pip install mysql
Any idea about how I can install mysql-python package or someone similar to use MySQLdb module if it's possible?
I am steering my learning wheel towards airflow during this weekend and while setting up and installing airflow at local machine using pip install apache-airflow, I'm getting following errors:
(base) ItGuy-MacBook-Pro:~ gofrogs$ pip install apache-airflow
Stored in directory: /Users/gofrogs/Library/Caches/pip/wheels/41/d4/fa/31df9cc56ee41572a4dfc1be7dfc87df59a5d6a7fd03e97eab
Building wheel for setproctitle (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/gofrogs/Downloads/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/setup.py'"'"'; __file__='"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/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/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-wheel-78zrb1fy
cwd: /private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/
Complete output (10 lines):
running bdist_wheel
running build
running build_ext
building 'setproctitle' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/gofrogs/Downloads/anaconda3/include -arch x86_64 -I/Users/gofrogs/Downloads/anaconda3/include -arch x86_64 -DSPT_VERSION=1.1.10 -D__darwin__=1 -I/Users/gofrogs/Downloads/anaconda3/include/python3.7m -c src/setproctitle.c -o build/temp.macosx-10.9-x86_64-3.7/src/setproctitle.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for setproctitle
and
Successfully built thrift flask-admin termcolor alembic dill pendulum flask-login flask-swagger json-merge-patch tzlocal Flask-JWT-Extended sqlalchemy-utils Flask-OpenID
Failed to build setproctitle
Installing collected packages: thrift, flask-caching, cached-property, wtforms, flask-admin, lockfile, python-daemon, tabulate, configparser, markdown, sqlalchemy-jsonfield, text-unidecode, termcolor, python-editor, Mako, alembic, dill, attrs, pytzdata, tzlocal, pendulum, argcomplete, setproctitle, PyJWT, Flask-JWT-Extended, marshmallow, flask-wtf, Flask-Babel, marshmallow-enum, Flask-SQLAlchemy, prison, flask-login, sqlalchemy-utils, apispec, marshmallow-sqlalchemy, python3-openid, Flask-OpenID, flask-appbuilder, cattrs, colorlog, graphviz, typing-extensions, croniter, flask-swagger, iso8601, tenacity, funcsigs, json-merge-patch, zope.deprecation, gunicorn, apache-airflow
Attempting uninstall: attrs
Found existing installation: attrs 19.2.0
Uninstalling attrs-19.2.0:
Successfully uninstalled attrs-19.2.0
Running setup.py install for setproctitle ... error
ERROR: Command errored out with exit status 1:
command: /Users/gofrogs/Downloads/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/setup.py'"'"'; __file__='"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/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/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-record-cl1apnxt/install-record.txt --single-version-externally-managed --compile --install-headers /Users/gofrogs/Downloads/anaconda3/include/python3.7m/setproctitle
cwd: /private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/
Complete output (10 lines):
running install
running build
running build_ext
building 'setproctitle' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/gofrogs/Downloads/anaconda3/include -arch x86_64 -I/Users/gofrogs/Downloads/anaconda3/include -arch x86_64 -DSPT_VERSION=1.1.10 -D__darwin__=1 -I/Users/gofrogs/Downloads/anaconda3/include/python3.7m -c src/setproctitle.c -o build/temp.macosx-10.9-x86_64-3.7/src/setproctitle.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/gofrogs/Downloads/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/setup.py'"'"'; __file__='"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/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/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-record-cl1apnxt/install-record.txt --single-version-externally-managed --compile --install-headers /Users/gofrogs/Downloads/anaconda3/include/python3.7m/setproctitle Check the logs for full command output.
Could you please suggest me what needs to be fixed? Also, if possible please share link(s) to detailed explanation/tutorials about airflow so I/future readers can follow the best resources?
Your issue is typically related to Xcode toolkit.
Type this command in your terminal
xcode-select --install
If that doesn't work, you can always try to update the toolkit first.
I want to install crfsuite for python3 using
pip3 install python-crfsuite
but it throws an error.
Building wheel for python-crfsuite (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.7/bin
/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/private/var/folders/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-
install-jcwoi004/python-crfsuite/setup.py'"'"';
__file__='"'"'/private/var/folders
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-install-jcwoi004/python-
crfsuite/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
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-wheel-evw_5zco --python-
tag cp37
cwd: /private/var/folders/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn
/T/pip-install-jcwoi004/python-crfsuite/
Complete output (25 lines):
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/pycrfsuite
copying pycrfsuite/__init__.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
copying pycrfsuite/_dumpparser.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
copying pycrfsuite/_logparser.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
running build_ext
building 'pycrfsuite._pycrfsuite' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/pycrfsuite
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/crf
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite
/lib/crf/src
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/swig
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/cqdb
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/cqdb/src
creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs
creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs/lib
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-
common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g
-Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include
-Ipycrfsuite -I/Library/Frameworks/Python.framework/Versions
/3.7/include/python3.7m -c pycrfsuite/_pycrfsuite.cpp -o
build/temp.macosx-10.9-x86_64-3.7/pycrfsuite/_pycrfsuite.o -std=c99
error: invalid argument '-std=c99' not allowed with 'C++/ObjC++'
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for python-crfsuite
Running setup.py clean for python-crfsuite
Failed to build python-crfsuite
Installing collected packages: python-crfsuite
Running setup.py install for python-crfsuite ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.7/bin
/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/private/var/folders/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-
install-jcwoi004/python-crfsuite/setup.py'"'"';
__file__='"'"'/private/var/folders
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-install-jcwoi004/python-
crfsuite/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
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-record-xhn2aymp/install-
record.txt --single-version-externally-managed --compile
cwd: /private/var/folders
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-install-jcwoi004/python-
crfsuite/
Complete output (25 lines):
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/pycrfsuite
copying pycrfsuite/__init__.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
copying pycrfsuite/_dumpparser.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
copying pycrfsuite/_logparser.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
running build_ext
building 'pycrfsuite._pycrfsuite' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/pycrfsuite
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/crf
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/crf/src
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/swig
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/cqdb
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite
/lib/cqdb/src
creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs
creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs/lib
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-
common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g
-Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include
-Ipycrfsuite -I/Library/Frameworks/Python.framework/Versions
/3.7/include/python3.7m -c pycrfsuite/_pycrfsuite.cpp -o
build/temp.macosx-10.9-x86_64-3.7/pycrfsuite/_pycrfsuite.o -std=c99
error: invalid argument '-std=c99' not allowed with
'C++/ObjC++'
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 -u -c 'import sys,
setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-install-jcwoi004/python-
crfsuite/setup.py'"'"'; __file__='"'"'/private/var/folders
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-install-jcwoi004/python-
crfsuite/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
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-record-xhn2aymp/install-
record.txt --single-version-externally-managed --compile Check the
logs for full command output.
I haven't seen anyone else with the same problem, perhaps it's something obvious that I just can't see. I'm also new to MacOS and this didn't happen to me on Windows.
the pip version is 19.2.3 .
If somebody could please help me with this.
There are a bunch of issues about this problem on the github repo, but are mostly closed with a reference to just use conda install, which is not really applicable in this case. One of them is mentioned in a pull request removing the flag causing the problem, so you might try installing from source, using the version from the pedning pull request like so:
pip install git+git://github.com/kvinwang/python-crfsuite.git#fix69