Build errors when trying to install pylibmc - python

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.

Related

Why is python giving me a fatal error upon downloading a package?

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

Error in installing mecab-python3 on Mac OS

My computer is MacOS Mojave 10.14.3.
When I install:
pip install mecab-python3
And I received the following error message:
Collecting mecab-python3
Using cached https://files.pythonhosted.org/packages/ac/48/295efe525df40cbc2173748eb869290e81a57e835bc41f6d3834fc5dad5f/mecab-python3-0.996.1.tar.gz
Building wheels for collected packages: mecab-python3
Building wheel for mecab-python3 (setup.py) ... error
Complete output from command /Users/lingvisa/anaconda3/envs/chatbot/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qj/v415xt754t1cllp2z16ld5yh0000gn/T/pip-install-ncm7s6a0/mecab-python3/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/qj/v415xt754t1cllp2z16ld5yh0000gn/T/pip-wheel-_61xc4rh --python-tag cp36:
running bdist_wheel
running build
running build_py
running build_ext
building '_MeCab' extension
swigging MeCab.i to MeCab_wrap.cpp
swig -python -shadow -c++ -I/usr/local/Cellar/mecab/0.996/include -o MeCab_wrap.cpp MeCab.i
/usr/local/Cellar/mecab/0.996/include/mecab.h:848: Warning 302: Identifier 'set_sentence' redefined by %extend (ignored),
MeCab.i:89: Warning 302: %extend definition of 'set_sentence'.
creating build
creating build/temp.macosx-10.7-x86_64-3.6
/usr/local/Cellar/gcc/8.3.0/bin/gcc-8 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lingvisa/anaconda3/envs/chatbot/include -arch x86_64 -I/Users/lingvisa/anaconda3/envs/chatbot/include -arch x86_64 -I/usr/local/Cellar/mecab/0.996/include -I/Users/lingvisa/anaconda3/envs/chatbot/include/python3.6m -c MeCab_wrap.cpp -o build/temp.macosx-10.7-x86_64-3.6/MeCab_wrap.o
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
MeCab_wrap.cpp: In function 'void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)':
MeCab_wrap.cpp:8524:22: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying 10 bytes from a string of the same length [-Wstringop-truncation]
strncpy(buff, "swig_ptr: ", 10);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
creating build/lib.macosx-10.7-x86_64-3.6
g++ -bundle -undefined dynamic_lookup -L/Users/lingvisa/anaconda3/envs/chatbot/lib -arch x86_64 -L/Users/lingvisa/anaconda3/envs/chatbot/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/MeCab_wrap.o -L/usr/local/Cellar/mecab/0.996/lib -lmecab -lstdc++ -o build/lib.macosx-10.7-x86_64-3.6/_MeCab.cpython-36m-darwin.so
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1
----------------------------------------
Failed building wheel for mecab-python3
Running setup.py clean for mecab-python3
Failed to build mecab-python3
Installing collected packages: mecab-python3
Running setup.py install for mecab-python3 ... error
Complete output from command /Users/lingvisa/anaconda3/envs/chatbot/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qj/v415xt754t1cllp2z16ld5yh0000gn/T/pip-install-ncm7s6a0/mecab-python3/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/qj/v415xt754t1cllp2z16ld5yh0000gn/T/pip-record-u3x1oulr/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
running build_ext
building '_MeCab' extension
swigging MeCab.i to MeCab_wrap.cpp
swig -python -shadow -c++ -I/usr/local/Cellar/mecab/0.996/include -o MeCab_wrap.cpp MeCab.i
/usr/local/Cellar/mecab/0.996/include/mecab.h:848: Warning 302: Identifier 'set_sentence' redefined by %extend (ignored),
MeCab.i:89: Warning 302: %extend definition of 'set_sentence'.
creating build
creating build/temp.macosx-10.7-x86_64-3.6
/usr/local/Cellar/gcc/8.3.0/bin/gcc-8 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lingvisa/anaconda3/envs/chatbot/include -arch x86_64 -I/Users/lingvisa/anaconda3/envs/chatbot/include -arch x86_64 -I/usr/local/Cellar/mecab/0.996/include -I/Users/lingvisa/anaconda3/envs/chatbot/include/python3.6m -c MeCab_wrap.cpp -o build/temp.macosx-10.7-x86_64-3.6/MeCab_wrap.o
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
MeCab_wrap.cpp: In function 'void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)':
MeCab_wrap.cpp:8524:22: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying 10 bytes from a string of the same length [-Wstringop-truncation]
strncpy(buff, "swig_ptr: ", 10);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
creating build/lib.macosx-10.7-x86_64-3.6
g++ -bundle -undefined dynamic_lookup -L/Users/lingvisa/anaconda3/envs/chatbot/lib -arch x86_64 -L/Users/lingvisa/anaconda3/envs/chatbot/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/MeCab_wrap.o -L/usr/local/Cellar/mecab/0.996/lib -lmecab -lstdc++ -o build/lib.macosx-10.7-x86_64-3.6/_MeCab.cpython-36m-darwin.so
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1
----------------------------------------
Command "/Users/lingvisa/anaconda3/envs/chatbot/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qj/v415xt754t1cllp2z16ld5yh0000gn/T/pip-install-ncm7s6a0/mecab-python3/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/qj/v415xt754t1cllp2z16ld5yh0000gn/T/pip-record-u3x1oulr/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/qj/v415xt754t1cllp2z16ld5yh0000gn/T/pip-install-ncm7s6a0/mecab-python3/
I installed 'swig' separately, and it works fine:
brew install swig
What may be the problem? I hope no modification is needed for the setup.py of the original code. Is that because my Mac to new?
Thanks for help.
It doesn't look like this is a newness issue. I would restart your machine and try again. Also, I would try to use another import method.
Good Luck!

pycryptodome setup.py causing an error when installing pyrebase

I am trying to install Pyrebase, but I keep getting an error that I believe is caused by setup.py for pycryptodome. I have searched all over but cannot find a solution, does anyone know how to solve this?
My output is below - I added in (...) in places to truncate the output, which was creating and copying libraries.
Thanks for the help
(backend-ragxWAh7) bash-3.2$ pip install Pyrebase
Collecting Pyrebase
(...)
Building wheels for collected packages: pycryptodome
Running setup.py bdist_wheel for pycryptodome ... error
Complete output from command /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/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/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-wheel-8ox7HU --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-intel-2.7
creating build/lib.macosx-10.14-intel-2.7/Crypto
copying lib/Crypto/__init__.py -> build/lib.macosx-10.14-intel-2.7/Crypto
(...)
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigVerPSS_186-3.rsp -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
warning: PCTBuildPy: byte-compiling is disabled, skipping.
running build_ext
warning: no support for Intel AESNI instructions
building 'Crypto.Hash._MD2' extension
creating build/temp.macosx-10.14-intel-2.7
creating build/temp.macosx-10.14-intel-2.7/src
cc -fno-strict-aliasing -fno-common -dynamic -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 -DLTC_NO_ASM -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.14-intel-2.7/src/MD2.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'cc' failed with exit status 1
----------------------------------------
Failed building wheel for pycryptodome
Running setup.py clean for pycryptodome
Failed to build pycryptodome
Installing collected packages: pycryptodome, Pyrebase
Running setup.py install for pycryptodome ... error
Complete output from command /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/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/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-record-1TJZWz/install-record.txt --single-version-externally-managed --compile --install-headers /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/include/site/python2.7/pycryptodome:
running install
running build
running build_py
(...)
creating build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5/SigVer15_186-3.rsp -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5/SigGen15_186-3.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5/SigGen15_186-2.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
creating build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigGenPSS_186-2.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigGenPSS_186-3.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigVerPSS_186-3.rsp -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
warning: PCTBuildPy: byte-compiling is disabled, skipping.
running build_ext
warning: no support for Intel AESNI instructions
building 'Crypto.Hash._MD2' extension
creating build/temp.macosx-10.14-intel-2.7
creating build/temp.macosx-10.14-intel-2.7/src
cc -fno-strict-aliasing -fno-common -dynamic -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 -DLTC_NO_ASM -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.14-intel-2.7/src/MD2.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/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/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-record-1TJZWz/install-record.txt --single-version-externally-managed --compile --install-headers /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/include/site/python2.7/pycryptodome" failed with error code 1 in /private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/
You don't have a valid C compiler environment (xcode).
See also here: https://apple.stackexchange.com/questions/254380/macos-mojave-invalid-active-developer-path.
install pycryptodome from github
go into lib/Crypto/PublicKey
get RSA.py file from there
and import it into pyerbase.py file as single file like import rsa

Python issue with pycurl and openssl

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

gcc: _mssql.c: No such file or directory

I'm trying to compile pymssql for python 2.5. I'm doing this because I think the version of pymssql I have is compiled for python 2.4. This is the error I get which makes me think that:
/home/username/lib/python2.5/pymssql.py:30: RuntimeWarning: Python C API version mismatch for module _mssql: This Python has API version 1013, module _mssql has version 1012.
import _mssql
Anyway I'm on Ubuntu 10.10 and have installed python2.5 and python2.5-dev via the deadsnakes ppa. I've created an virtualenv with using python2.5 like so
mkvirtualenv pymssql -p /usr/bin/python2.5
I've install cython from pip and am trying to install pymssql from pip but am getting this error
Downloading/unpacking pymssql
Running setup.py egg_info for package pymssql
Installing collected packages: pymssql
Running setup.py install for pymssql
building '_mssql' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/neil/virtualenv/pymssql/build/pymssql/freetds/nix_32/include -I/usr/include/python2.5 -c _mssql.c -o build/temp.linux-i686-2.5/_mssql.o -DMSDBLIB
gcc: _mssql.c: No such file or directory
gcc: no input files
error: command 'gcc' failed with exit status 1
Complete output from command /home/neil/virtualenv/pymssql/bin/python2.5 -c "import setuptools;__file__='/home/neil/virtualenv/pymssql/build/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-cEGXRy-record/install-record.txt --install-headers /home/neil/virtualenv/pymssql/include/site/python2.5:
running install
running build
running build_ext
building '_mssql' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/neil/virtualenv/pymssql/build/pymssql/freetds/nix_32/include -I/usr/include/python2.5 -c _mssql.c -o build/temp.linux-i686-2.5/_mssql.o -DMSDBLIB
gcc: _mssql.c: No such file or directory
gcc: no input files
error: command 'gcc' failed with exit status 1
----------------------------------------
Command /home/neil/virtualenv/pymssql/bin/python2.5 -c "import setuptools;__file__='/home/neil/virtualenv/pymssql/build/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-cEGXRy-record/install-record.txt --install-headers /home/neil/virtualenv/pymssql/include/site/python2.5 failed with error code 1
Storing complete log in /home/neil/.pip/pip.log
Any ideas how to resolve this?
Turns out I needed to install pyrex from pip.
pip install pyrex

Categories

Resources