I am trying to run code that uses pycurl but when I do i get the following error:
uilleann-pipes-160:data_collection Jim$ python xlsxDownloader.py
Traceback (most recent call last):
File "xlsxDownloader.py", line 21, in <module>
from import_hedgehogs import Link
File "/Users/Jim/Documents/Hedgehogs/hedgehogs/data_collection/import_hedgehogs.py", line 8, in <module>
import pycurl
ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)
When I do "which pycurl" in terminal it gives no output so I then tried installing pycurl using "pip install pycurl". However, When I do that I get the following error:
uilleann-pipes-160:data_collection Jim$ pip install pycurl
Collecting pycurl
Using cached pycurl-7.43.0.1.tar.gz
Installing collected packages: pycurl
Running setup.py install for pycurl ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/zw/hmv25ltn4hxcr3t9lrx7fc9r0000gn/T/pip-build-gqCefl/pycurl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/zw/hmv25ltn4hxcr3t9lrx7fc9r0000gn/T/pip-Vbtxf4-record/install-record.txt --single-version-externally-managed --compile:
Using curl-config (libcurl 7.54.0)
running install
running build
running build_py
creating build
creating build/lib.macosx-10.13-intel-2.7
creating build/lib.macosx-10.13-intel-2.7/curl
copying python/curl/__init__.py -> build/lib.macosx-10.13-intel-2.7/curl
running build_ext
building 'pycurl' extension
creating build/temp.macosx-10.13-intel-2.7
creating build/temp.macosx-10.13-intel-2.7/src
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.1" -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/docstrings.c -o build/temp.macosx-10.13-intel-2.7/src/docstrings.o
In file included from src/docstrings.c:4:
src/pycurl.h:164:13: fatal error: 'openssl/ssl.h' file not found
# include <openssl/ssl.h>
^~~~~~~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/zw/hmv25ltn4hxcr3t9lrx7fc9r0000gn/T/pip-build-gqCefl/pycurl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/zw/hmv25ltn4hxcr3t9lrx7fc9r0000gn/T/pip-Vbtxf4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/zw/hmv25ltn4hxcr3t9lrx7fc9r0000gn/T/pip-build-gqCefl/pycurl/
Install the first two packages
sudo apt-get install libcurl4-openssl-dev
python -m pip install pybind11
These are optional
sudo apt install libgmp-dev libmpfr-dev libmpc-dev
sudo apt install libssl-dev
sudo apt-get install unixodbc unixodbc-dev
Related
I am running Centos7 with Python 3.6. I am trying to install pycrypto with the command "pip3 install pycrypto". I also installed the dev tools, so gcc is installed. I am getting the following output.
What am I missing?
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash._MD2' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
gcc -pthread -Wno-unused-result -Wsign-compare -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 -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python3.6m -c src/MD2.c -o build/temp.linux-x86_64-3.6/src/MD2.o
src/MD2.c:31:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-h6pl3s2f/pycrypto/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-9fjag3e5-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-h6pl3s2f/pycrypto/
That did not work, but I did find the answer in the article.
I ran "yum -y install python3-devel" and this fixed my issue. I was then able to install pycrypto.
I also had the same issue for CentOS.
However, it turned out I was missing one of the dependencies.
sudo yum install gcc
sudo yum install gcc-c++
sudo yum install python-devel
sudo pip install pycrypto
When trying to install Marine-traffic-api im getting an error:
Installing collected packages: ujson, Marine-Traffic-API
Running setup.py install for ujson: started
Running setup.py install for ujson: finished with status 'error'
Complete output from command /home/benjamin/PycharmProjects/ShipTracking/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/ujson/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-ys30b_z8/install-record.txt --single-version-externally-managed --compile --install-headers /home/benjamin/PycharmProjects/ShipTracking/venv/include/site/python3.7/ujson:
Warning: 'classifiers' should be a list, got type 'filter'
running install
running build
running build_ext
building 'ujson' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/python
creating build/temp.linux-x86_64-3.7/lib
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./python -I./lib -I/home/benjamin/PycharmProjects/ShipTracking/venv/include -I/usr/include/python3.7m -c ./python/ujson.c -o build/temp.linux-x86_64-3.7/./python/ujson.o -D_GNU_SOURCE
In file included from ./python/ujson.c:39:0:
./python/py_defines.h:39: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
Install the needed packages:
sudo apt-get install build-essential python3 python-dev python3-dev
After that, run:
pip install --no-cache-dir ujson
I tried to install a python package from PyPI with the following command
sudo pip3 install switcheo
The installation fails and show this error message:
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c scrypt-1.2.1/libcperciva/util/asprintf.c -o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/asprintf.o
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.7/src/scrypt.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/crypto/crypto_scrypt.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/scryptenc/scryptenc.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/util/memlimit.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/alg/sha256.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes_aesni.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/crypto/crypto_aesctr.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/crypto/crypto_entropy.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/entropy.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/insecure_memzero.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/warnp.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/humansize.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/asprintf.o -lcrypto -o build/lib.macosx-10.9-x86_64-3.7/_scrypt.cpython-37m-darwin.so
ld: library not found for -lcrypto
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 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-2cof4cvu/scrypt/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/tmp/pip-record-1ecvxjh1/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-2cof4cvu/scrypt/
Install the libssl-dev package
On Ubuntu, it's as simple as sudo apt-get install libssl-dev
On mac, you need to install openssl: brew install openssl
If that doesn't work, you need to install Homebrew. You should use Homebrew, it makes installing much easier.
If that still doesn't work, you can install libssl-dev and make a symlink:
ln -s /usr/local/Cellar/openssl/1.0.2p/lib/libssl.dylib /usr/local/lib/
I am using synology NAS and python(installed 2.7, 3.5)
when I try to install via PIP, I encounter this error message.
(the first time, I met curl-config not found error.
but now with several entware packages, I met with the message below)
----------
python3 -m pip install pycurl
Collecting pycurl
Using cached pycurl-7.43.0.tar.gz
Building wheels for collected packages: pycurl
Running setup.py bdist_wheel for pycurl ... error
Complete output from command /usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-79dqoc3v/pycurl/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/tmpa8e0oiyqpip-wheel- --python-tag cp35:
Using curl-config (libcurl 7.55.0)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/curl
copying python/curl/__init__.py -> build/lib.linux-x86_64-3.5/curl
running build_ext
building 'pycurl' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DSYNOPLAT_F_X86_64 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DPYCURL_VERSION="7.43.0" -DHAVE_CURL_SSL=1 -I/opt/include -I/volume1/#appstore/py3k/usr/local/include/python3.5m -c src/docstrings.c -o build/temp.linux-x86_64-3.5/src/docstrings.o
unable to execute '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc': No such file or directory
error: command '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pycurl
Running setup.py clean for pycurl
Failed to build pycurl
Installing collected packages: pycurl
Running setup.py install for pycurl ... error
Complete output from command /usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-79dqoc3v/pycurl/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-q_rurvzr-record/install-record.txt --single-version-externally-managed --compile:
Using curl-config (libcurl 7.55.0)
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/curl
copying python/curl/__init__.py -> build/lib.linux-x86_64-3.5/curl
running build_ext
building 'pycurl' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DSYNOPLAT_F_X86_64 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DPYCURL_VERSION="7.43.0" -DHAVE_CURL_SSL=1 -I/opt/include -I/volume1/#appstore/py3k/usr/local/include/python3.5m -c src/docstrings.c -o build/temp.linux-x86_64-3.5/src/docstrings.o
unable to execute '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc': No such file or directory
error: command '/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-79dqoc3v/pycurl/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-q_rurvzr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-79dqoc3v/pycurl/
I just had this problem too with by Synology DS415+. The only difference is that I tried to install netdisco.
I found that setting the CC environmental variable to the actual location of gcc compiler in advance helped
# export CC=/opt/bin/gcc
Just got a new laptop, setting up my dev environment from scratch, and I'm getting this weird error that doesn't seem to be a result of missing dependencies (though I could be wrong). I'm working in a virtualenv with Python 2.7.3. Libevent, libmemcached and memcached were all installed with Homebrew earlier.
(grlli)Tylers-MacBook-Pro:grlli tyler$ pip install pylibmc
Downloading/unpacking pylibmc
Running setup.py egg_info for package pylibmc
Installing collected packages: pylibmc
Running setup.py install for pylibmc
building '_pylibmc' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DUSE_ZLIB -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _pylibmcmodule.c -o build/temp.macosx-10.8-intel-2.7/_pylibmcmodule.o -fno-strict-aliasing
_pylibmcmodule.c:1895:33: error: member reference base type 'const void' is not a structure or union
svr->hostname, svr->port);
~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_stdio.h:56:62: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^
1 error generated.
error: command 'cc' failed with exit status 1
Complete output from command /Users/tyler/projects/envs/grlli/bin/python -c "import setuptools;__file__='/Users/tyler/projects/envs/grlli/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1_/jkd0_x495gs0g8v7z2pgz3bc0000gn/T/pip-E_pLFk-record/install-record.txt --single-version-externally-managed --install-headers /Users/tyler/projects/envs/grlli/bin/../include/site/python2.7:
running install
running build
running build_py
running build_ext
building '_pylibmc' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DUSE_ZLIB -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _pylibmcmodule.c -o build/temp.macosx-10.8-intel-2.7/_pylibmcmodule.o -fno-strict-aliasing
_pylibmcmodule.c:1895:33: error: member reference base type 'const void' is not a structure or union
svr->hostname, svr->port);
~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_stdio.h:56:62: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command /Users/tyler/projects/envs/grlli/bin/python -c "import setuptools;__file__='/Users/tyler/projects/envs/grlli/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1_/jkd0_x495gs0g8v7z2pgz3bc0000gn/T/pip-E_pLFk-record/install-record.txt --single-version-externally-managed --install-headers /Users/tyler/projects/envs/grlli/bin/../include/site/python2.7 failed with error code 1 in /Users/tyler/projects/envs/grlli/build/pylibmc
Storing complete log in /Users/tyler/.pip/pip.log
Any help is greatly appreciated!
I ran into the same issue. The one thing that fixed it for me was updating setuptools to the latest version.
pip install setuptools --upgrade
Try to install pylibmc 1.2.3, it helped me.