I tried to install spams using PiP command but i get this error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-zI4__D/spams/setup.py", line 121, in <module>
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
TypeError: 'encoding' is an invalid keyword argument for this function
So, i download the zipped file of spams, and i modified the setup.py file to prevent the encoding keyword problem, and when i install the library i get this error:
warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -llapack
collect2: error: ld returned 1 exit status
error: Command "g++ -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/spams_wrap/spams_wrap.o -L/usr/local/lib64 -L/usr/local/lib -L/usr/lib64 -L/usr/lib -L/usr/lib/ -L/usr/lib64 -lstdc++ -lblas -llapack -lpython2.7 -o build/lib.linux-x86_64-2.7/_spams_wrap.so -fopenmp" failed with exit status 1
When i try "pip install spams==2.6.1", i get this error:
error: Command "gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_ FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOUR CE -fPIC -fwrapv -fPIC -I. -Ispams/linalg -Ispams/prox -Ispams/decomp -Ispams/di ctLearn -I/home/aabdelli/.local/lib/python2.7/site-packages/numpy/core/include - I/usr/include/python2.7 -I/usr/local/include -I/usr/include -I/usr/include/pytho n2.7 -c spams_wrap.cpp -o build/temp.linux-x86_64-2.7/spams_wrap.o -DNDEBUG -DUS E_BLAS_LIB -std=c++11 -fPIC -fopenmp -Wunused-variable -m64" failed with exit st atus 1
----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip- build-8cd3Ds/spams/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file __).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip- OH2Naf-record/install-record.txt --single-version-externally-managed --compile - -user --prefix=" failed with error code 1 in /tmp/pip-build-8cd3Ds/spams/
First upgrade pip:
pip install -U pip setuptools
SPAMS' setup.py imports numpy before installing it so first you have to install numpy:
pip install numpy
SPAMS requires BLAS and LAPACK. You need to install the libraries for Fedora. See https://fedoraproject.org/wiki/PackagingDrafts/BLAS_LAPACK. Try
yum install openblas lapack
Then go with SPAMS:
pip install spams==2.6.1
I ran into an issue installing mariadb connector for python on Ubuntu 20.04.
I did installed mariadb server and connector for C as they say in the docs:
sudo apt-get update
sudo apt-get install mariadb-server
sudo apt-get install libmariadb3
sudo apt-get install libmariadb-dev
Also installed:
sudo apt-get install libmariadbclient-dev
Then:
$ pip3 install mariadb
Collecting mariadb Using cached mariadb-1.0.3.tar.gz (66 kB) Building wheels for collected packages: mariadb Building wheel for mariadb (setup.py) ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-01wak5oz/mariadb/setup.py'"'"';
__file__='"'"'/tmp/pip-install-01wak5oz/mariadb/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-oazbv39u
cwd: /tmp/pip-install-01wak5oz/mariadb/ Complete output (40 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.8 creating build/lib.linux-x86_64-3.8/mariadb copying mariadb/__init__.py -> build/lib.linux-x86_64-3.8/mariadb creating build/lib.linux-x86_64-3.8/mariadb/constants copying mariadb/constants/__init__.py -> build/lib.linux-x86_64-3.8/mariadb/constants copying mariadb/constants/CLIENT.py -> build/lib.linux-x86_64-3.8/mariadb/constants copying mariadb/constants/INDICATOR.py -> build/lib.linux-x86_64-3.8/mariadb/constants copying mariadb/constants/CURSOR.py -> build/lib.linux-x86_64-3.8/mariadb/constants copying mariadb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.8/mariadb/constants running build_ext building 'mariadb._mariadb' extension creating build/temp.linux-x86_64-3.8 creating build/temp.linux-x86_64-3.8/mariadb x86_64-linux-gnu-gcc -pthread
-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPY_MARIADB_MAJOR_VERSION=1 -DPY_MARIADB_MINOR_VERSION=0 -DPY_MARIADB_PATCH_VERSION=3 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I./include -I/usr/include/python3.8 -c mariadb/mariadb.c -o build/temp.linux-x86_64-3.8/mariadb/mariadb.o
-DDEFAULT_PLUGINS_SUBDIR="/usr/lib/x86_64-linux-gnu/mariadb19/plugin" x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare
-DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPY_MARIADB_MAJOR_VERSION=1 -DPY_MARIADB_MINOR_VERSION=0 -DPY_MARIADB_PATCH_VERSION=3 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I./include -I/usr/include/python3.8 -c mariadb/mariadb_connection.c -o build/temp.linux-x86_64-3.8/mariadb/mariadb_connection.o
-DDEFAULT_PLUGINS_SUBDIR="/usr/lib/x86_64-linux-gnu/mariadb19/plugin" x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare
-DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPY_MARIADB_MAJOR_VERSION=1 -DPY_MARIADB_MINOR_VERSION=0 -DPY_MARIADB_PATCH_VERSION=3 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I./include -I/usr/include/python3.8 -c mariadb/mariadb_exception.c -o build/temp.linux-x86_64-3.8/mariadb/mariadb_exception.o
-DDEFAULT_PLUGINS_SUBDIR="/usr/lib/x86_64-linux-gnu/mariadb19/plugin" x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare
-DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPY_MARIADB_MAJOR_VERSION=1 -DPY_MARIADB_MINOR_VERSION=0 -DPY_MARIADB_PATCH_VERSION=3 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I./include -I/usr/include/python3.8 -c mariadb/mariadb_cursor.c -o build/temp.linux-x86_64-3.8/mariadb/mariadb_cursor.o
-DDEFAULT_PLUGINS_SUBDIR="/usr/lib/x86_64-linux-gnu/mariadb19/plugin" x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare
-DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPY_MARIADB_MAJOR_VERSION=1 -DPY_MARIADB_MINOR_VERSION=0 -DPY_MARIADB_PATCH_VERSION=3 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I./include -I/usr/include/python3.8 -c mariadb/mariadb_codecs.c -o build/temp.linux-x86_64-3.8/mariadb/mariadb_codecs.o
-DDEFAULT_PLUGINS_SUBDIR="/usr/lib/x86_64-linux-gnu/mariadb19/plugin" mariadb/mariadb_codecs.c: In function ‘mariadb_extended_field_type’: mariadb/mariadb_codecs.c:64:5: error: unknown type name ‘MARIADB_CONST_STRING’
64 | MARIADB_CONST_STRING str;
| ^~~~~~~~~~~~~~~~~~~~ mariadb/mariadb_codecs.c:66:10: warning: implicit declaration of function ‘mariadb_field_attr’ [-Wimplicit-function-declaration]
66 | if (!mariadb_field_attr(&str, field, MARIADB_FIELD_ATTR_FORMAT_NAME))
| ^~~~~~~~~~~~~~~~~~ mariadb/mariadb_codecs.c:66:42: error: ‘MARIADB_FIELD_ATTR_FORMAT_NAME’ undeclared (first use in this function)
66 | if (!mariadb_field_attr(&str, field, MARIADB_FIELD_ATTR_FORMAT_NAME))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mariadb/mariadb_codecs.c:66:42: note: each undeclared identifier is reported only once for each function it appears in mariadb/mariadb_codecs.c:68:14: error: request for member ‘length’ in something not a structure or union
68 | if (str.length == 4 && !strncmp(str.str, "json", 4))
| ^ mariadb/mariadb_codecs.c:68:42: error: request for member ‘str’ in something not a structure or union
68 | if (str.length == 4 && !strncmp(str.str, "json", 4))
| ^ error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
---------------------------------------- ERROR: Failed building wheel for mariadb Running setup.py clean for mariadb Failed to build mariadb
It seems that issue comes from:
mariadb/mariadb_codecs.c: In function ‘mariadb_extended_field_type’:
mariadb/mariadb_codecs.c:64:5: error: unknown type name ‘MARIADB_CONST_STRING’
But I'm not good in C and unable to investigate this right away.
Tried googling, but no results for issues caused by MARIADB_CONST_STRING type.
It is my first time installing mariadb connector for python on ubuntu.
Did anyone seen this error before? How should I proceed?
Appreciate your advise.
I went through more docs: https://mariadb.com/kb/en/installing-mariadb-deb-files/
What helped was:
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
Then again:
$ sudo apt-get update
$ sudo apt-get install libmariadb3
Now lets try to install Python mariadb lib:
$ pip3 install mariadb
Collecting mariadb
Using cached mariadb-1.0.3.tar.gz (66 kB)
Building wheels for collected packages: mariadb
Building wheel for mariadb (setup.py) ... done
Created wheel for mariadb: filename=mariadb-1.0.3-cp38-cp38-linux_x86_64.whl size=233300 sha256=607a788847d8d023a8921f7fc8fa9a5450b0e7f0625416de86d26cedfe202e73
Stored in directory: /home/sergey/.cache/pip/wheels/c5/56/1d/ade90f725a5f6a15b505bebc461ebfc573223e9836c5bf5603
Successfully built mariadb
Installing collected packages: mariadb
Successfully installed mariadb-1.0.3
Problem: pip3 install apex fails because of failure to build cryptacular, errors as below.
cryptacular was successfully installed (before attempts of installing apex) using this one-liner: pip3 install -e hg+https://bitbucket.org/dholth/cryptacular#cb96fb3#egg=cryptacular
Somehow it would not install with plain pip/pip3 install cryptacular, so the only way I found to successfully install this package is following these instructions, equivalent to these instructions.
However once I run pip3 install apex I receive the exact same error again.
It doesn't seem to be pip/pip3 issue - I've tried both with the same result.
Any ideas on what I am doing wrong?
Collecting apex
Collecting requests (from apex)
Using cached https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl
----------------------- loads of "collecting" messages -------------------------
Collecting PasteDeploy>=2.0 (from plaster-pastedeploy->pyramid>1.1.2->apex)
Using cached https://files.pythonhosted.org/packages/67/0c/faa9971b2e5e048b3b30008d04c72e4d5f63b42f48937c169acce2c5e70a/PasteDeploy-2.0.1-py2.py3-none-any.whl
Building wheels for collected packages: cryptacular
Running setup.py bdist_wheel for cryptacular ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-d8_sob/cryptacular/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/tmp7vBhDEpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/cryptacular
copying cryptacular/__init__.py -> build/lib.linux-x86_64-2.7/cryptacular
creating build/lib.linux-x86_64-2.7/cryptacular/bcrypt
copying cryptacular/bcrypt/__init__.py -> build/lib.linux-x86_64-2.7/cryptacular/bcrypt
copying cryptacular/bcrypt/test_bcrypt.py -> build/lib.linux-x86_64-2.7/cryptacular/bcrypt
creating build/lib.linux-x86_64-2.7/cryptacular/core
copying cryptacular/core/test_core.py -> build/lib.linux-x86_64-2.7/cryptacular/core
...
creating build/temp.linux-x86_64-2.7/cryptacular/bcrypt
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/crypt_blowfish.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/crypt_blowfish.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/crypt_gensalt.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/crypt_gensalt.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/wrapper.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/wrapper.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c cryptacular/bcrypt/_bcrypt.c -o build/temp.linux-x86_64-2.7/cryptacular/bcrypt/_bcrypt.o
In file included from /usr/include/python2.7/Python.h:47:0,
from cryptacular/bcrypt/_bcrypt.c:26:
crypt_blowfish-1.2/crypt.h:17:10: fatal error: gnu-crypt.h: No such file or directory
#include <gnu-crypt.h>
^~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for cryptacular
Running setup.py clean for cryptacular
Failed to build cryptacular
Installing collected packages: urllib3, certifi, chardet, idna, requests, wtforms, wtforms-recaptcha, setuptools, zope.interface, repoze.lru, PasteDeploy, plaster, plaster-pastedeploy, webob, venusian, zope.deprecation, translationstring, hupper, pyramid, oauthlib, requests-oauthlib, python-openid, anykeystore, velruse, transaction, repoze.sendmail, pyramid-mailer, SQLAlchemy, zope.sqlalchemy, pbkdf2, cryptacular, apex
Running setup.py install for cryptacular ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-d8_sob/cryptacular/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-Br1FfW-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
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/cryptacular
copying cryptacular/__init__.py -> build/lib.linux-x86_64-2.7/cryptacular
creating build/lib.linux-x86_64-2.7/cryptacular/bcrypt
copying cryptacular/bcrypt/__init__.py -> build/lib.linux-x86_64-2.7/cryptacular/bcrypt
...
creating build/temp.linux-x86_64-2.7/cryptacular/bcrypt
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/crypt_blowfish.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/crypt_blowfish.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/crypt_gensalt.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/crypt_gensalt.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/wrapper.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/wrapper.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c cryptacular/bcrypt/_bcrypt.c -o build/temp.linux-x86_64-2.7/cryptacular/bcrypt/_bcrypt.o
In file included from /usr/include/python2.7/Python.h:47:0,
from cryptacular/bcrypt/_bcrypt.c:26:
crypt_blowfish-1.2/crypt.h:17:10: fatal error: gnu-crypt.h: No such file or directory
#include <gnu-crypt.h>
^~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-d8_sob/cryptacular/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-Br1FfW-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-d8_sob/cryptacular/
UPDATE:
Once I force gnu-crypt.h into required place: cd /usr/include && sudo mv crypt.h gnu-crypt.h I get a new but similar error:
...
creating build/temp.linux-x86_64-2.7/cryptacular/bcrypt
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/crypt_blowfish.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/crypt_blowfish.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/crypt_gensalt.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/crypt_gensalt.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/wrapper.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/wrapper.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c cryptacular/bcrypt/_bcrypt.c -o build/temp.linux-x86_64-2.7/cryptacular/bcrypt/_bcrypt.o
In file included from cryptacular/bcrypt/_bcrypt.c:27:0:
crypt_blowfish-1.2/ow-crypt.h:27:14: error: conflicting types for ‘crypt_r’
extern char *crypt_r(__const char *key, __const char *setting, void *data);
^~~~~~~
In file included from crypt_blowfish-1.2/crypt.h:17:0,
from /usr/include/python2.7/Python.h:47,
from cryptacular/bcrypt/_bcrypt.c:26:
/usr/include/gnu-crypt.h:60:14: note: previous declaration of ‘crypt_r’ was here
extern char *crypt_r (const char *__key, const char *__salt,
^~~~~~~
cryptacular/bcrypt/_bcrypt.c: In function ‘init_bcrypt’:
cryptacular/bcrypt/_bcrypt.c:129:19: warning: unused variable ‘module’ [-Wunused-variable]
PyObject *module = Py_InitModule("_bcrypt", _bcrypt_methods);
^~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for cryptacular
Running setup.py clean for cryptacular
Failed to build cryptacular
Installing collected packages: urllib3, certifi, chardet, idna, requests, wtforms, wtforms-recaptcha, setuptools, zope.interface, repoze.lru, PasteDeploy, plaster, plaster-pastedeploy, webob, venusian, zope.deprecation, translationstring, hupper, pyramid, oauthlib, requests-oauthlib, python-openid, anykeystore, velruse, transaction, repoze.sendmail, pyramid-mailer, SQLAlchemy, zope.sqlalchemy, pbkdf2, cryptacular, apex
Running setup.py install for cryptacular ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pqj6l9/cryptacular/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-CRC3Cz-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
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/cryptacular
...
writing manifest file 'cryptacular.egg-info/SOURCES.txt'
copying cryptacular/bcrypt/_bcrypt.c -> build/lib.linux-x86_64-2.7/cryptacular/bcrypt
running build_ext
building 'cryptacular.bcrypt._bcrypt' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/crypt_blowfish-1.2
creating build/temp.linux-x86_64-2.7/cryptacular
creating build/temp.linux-x86_64-2.7/cryptacular/bcrypt
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/crypt_blowfish.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/crypt_blowfish.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/crypt_gensalt.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/crypt_gensalt.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c crypt_blowfish-1.2/wrapper.c -o build/temp.linux-x86_64-2.7/crypt_blowfish-1.2/wrapper.o
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 -DNO_BF_ASM -Icrypt_blowfish-1.2/ -I/usr/include/python2.7 -c cryptacular/bcrypt/_bcrypt.c -o build/temp.linux-x86_64-2.7/cryptacular/bcrypt/_bcrypt.o
In file included from cryptacular/bcrypt/_bcrypt.c:27:0:
crypt_blowfish-1.2/ow-crypt.h:27:14: error: conflicting types for ‘crypt_r’
extern char *crypt_r(__const char *key, __const char *setting, void *data);
^~~~~~~
In file included from crypt_blowfish-1.2/crypt.h:17:0,
from /usr/include/python2.7/Python.h:47,
from cryptacular/bcrypt/_bcrypt.c:26:
/usr/include/gnu-crypt.h:60:14: note: previous declaration of ‘crypt_r’ was here
extern char *crypt_r (const char *__key, const char *__salt,
^~~~~~~
cryptacular/bcrypt/_bcrypt.c: In function ‘init_bcrypt’:
cryptacular/bcrypt/_bcrypt.c:129:19: warning: unused variable ‘module’ [-Wunused-variable]
PyObject *module = Py_InitModule("_bcrypt", _bcrypt_methods);
^~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pqj6l9/cryptacular/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-CRC3Cz-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-pqj6l9/cryptacular/
Uninstall the previous versions of apex. Then do these steps:
git clone https://www.github.com/nvidia/apex
cd apex
python setup.py install
worked like charm for me
I have instaled basic version of Airflow which uses Sqlite as metastore. Now i am trying to install other Packages.
I tried the below Packages but failed with mysqlclient issue.
pip install apache-airflow[devel]
Error message with compile statement as below,
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Dversion_info=(1,3,14,'final',0) -D__version__=1.3.14 -I/usr/include/mysql -I/opt/python-2.7.15/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX -DUNIV_LINUX
_mysql.c:29:19: error: mysql.h: No such file or directory
_mysql.c:30:26: error: mysqld_error.h: No such file or directory
_mysql.c:48:20: error: errmsg.h: No such file or directory
_mysql.c:67: error: expected specifier-qualifier-list before ‘MYSQL’
Final Failure Command in log:
Command "/home/usr/Airflow_Workspace/install/bin/python -u -c "import
setuptools,
tokenize;file='/tmp/pip-install-yeFo2f/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-Bw_HED/install-record.txt --single-version-externally-managed --compile --install-headers /home/usr/Airflow_Workspace/install/include/site/python2.7/mysqlclient"
failed with error code 1 in /tmp/pip-install-yeFo2f/mysqlclient/
I tried installing many dependency for python but still not resolved. Could someone help me what exactly I am missing.
If you're on Ubuntu/Debian, you need the libmysqlclient-dev system package first.
sudo apt install libmysqlclient-dev
I have OS
Red Hat Enterprise Linux Server release 7.4 (Maipo)
and python
Python 2.7.13 :: Anaconda 4.4.0 (64-bit)
Tried to install lib sasl
sudo pip install sasl
Collecting sasl
Downloading http://repo.com/api/pypi/pypi/packages/8e/2c/45dae93d666aea8492678499e0999269b4e55f1829b1e4de5b8204706ad9/sasl-0.2.1.tar.gz
Collecting six (from sasl)
Downloading http://repo.com/api/pypi/pypi/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, sasl
building 'sasl.saslwrapper' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/sasl
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Isasl -I/usr/include/python2.7 -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-2.7/sasl/saslwrapper.o
In file included from sasl/saslwrapper.cpp:254:0:
sasl/saslwrapper.h:22:23: fatal error: sasl/sasl.h: No such file or directory
#include <sasl/sasl.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Ym7ZOA/sasl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_8ahws-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Ym7ZOA/sasl/
How solve this problem?
if you are on AWS EC2/EMR or CentOS, sudo yum install cyrus-sasl-devel
From this issue, it seems that you need the libsasl2.
You can install libsasl2 by using the command :-
sudo apt-get install libsasl2-dev