I have a newish Slackware 14.1 64-bit install (Python 2.7.5), and am trying to install pygraphviz via pip.
When I run:
pip install pygraphviz
however, I get the following error:
In file included from /usr/include/python2.7/Python.h:8:0,
from pygraphviz/graphviz_wrap.c:124:
/usr/include/python2.7/pyconfig.h:6:25: fatal error: pyconfig-64.h: No such file or directory
#include "pyconfig-64.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
The referenced pyconfig.h file is:
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#include "pyconfig-32.h"
#elif __WORDSIZE == 64
#include "pyconfig-64.h"
#else
#error "Unknown word size"
#endif
Looking around, there is a lot of info for missing a pyconfig.h file, but not the 64 variant, and I'm struggling to find the package to install to take care of this. I tried to use rpm2tgz and the python-devel rpm for 2.7.5 from Fedora, but it didn't take care of the issue. Also, as I'm running slack, a yum or apt-get command isn't a valid solution, I need to know where I can find the actual package.
to solve problem you need to install python dev pakege
sudo apt-get install python2.7-dev
Related
pip install pyaudio failed on MacOS with error src/_portaudiomodule.c:27:19: fatal error: stdio.h: No such file or directory #include <stdio.h>
After doing some research I ran the following commands:
1/ export CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/
2/ pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
But got errors /usr/local/include/portaudio.h:114:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes] and error: command 'gcc' failed with exit status 1 instead.
It seems upgrading to MacOS Catalina messed up my Xcode Developer Tools C headers but am not able to resolve it.
i was able to solve this by copying portaudio.h from /usr/local/include/ to anaconda3/include.
I'm trying to install pyCLD3 on Windows 10 (python 3.8.5):
pip install pycld3 on Windows does not work (as expected, it's mentioned in the README file on their Github).
However, the instructions how to install it from Source are not clear, it only states that I need some prerequisites and gives an unclear reference on how to install one of them (Protobuf), but not the others and not how to proceed to install pyClD3 itself.
I managed to install Protoc using Chocolatey consulting this post, however, I'm not sure if that's how I should have done it and how to proceed next, i.e. what are the Protobuf development headers and where to find libprotoc library - is it the same thing as Protobuf/protoc?
As for g++, I have installed MinGW from here, but also confused what to do with it next.
Here is a snippet of what I get when I try to install pyCLD3 using pip:
Building wheels for collected packages: pycld3
Building wheel for pycld3 (setup.py) ... error
ERROR: Command errored out with exit status 1:
<...>
Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpcld3/pycld3.cpp /Fobuild\temp.win-amd64-3.8\Release\cld3/pycld3.obj -std=c++11
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
pycld3.cpp
C:\Users\me\AppData\Local\Temp\pip-install-1lgq4b5o\pycld3_11fb5b01d9d44711b4031f733ec7f6cc\src\cld_3/protos/feature_extractor.pb.h(10): fatal error C1083: Cannot open include file: 'google/protobuf/port_def.inc': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for pycld3
You may try Msys2. I managed to compile pycld3 in Windows 10 with Python3.7.
In Windows 10's cmd
download pycld3-0.20.tar.gz from https://pypi.org/project/pycld3/#files, untar it and cd to that directory
creatae a Py3.7 virtual environ (py -3.7 -m venv venv). (I dont know whether other Python versions work or not.)
Msys2
install msys2 https://www.msys2.org/
start msys2 (c:\msys64\msys2.exe)
update msys2: do a few pacman -Syuu as necessary
install the toolchain (pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb mingw-w64-x86_64-make)
install protoc (pacman -S mingw-w64-x86_64-protobuf, protoc installed by choco didnt work in my experiment but this protoc works)
setup PATH (export PATH=$PATH:/mingw64/bin/)
insert a #include <math.h> line before line 6 of Python.h (e.g C:\Python\Python37\include\Python.h in my case). This fixed the _hypot related errors.
compile and install (go to the directory above, e.g. cd /c/Users/xyz/Downloads/pycld3-0.20/pycld3-0.20 and execute ./venv/Scripts/python.exe setup.py build)
I managed to successfully build pycld3 but was unable to isntall -- got some ValueError: ZIP does not support timestamps before 1980 error when I tried venv/Scripts/python setup.py install.
Please accept my answer if it fixes your 'google/protobuf/port_def.inc': No such file or directory problem:).
I am trying to install guppy. My program uses python3 so I must use pip3 exclusively. When I run:
pip3 install guppy
I get:
src/sets/sets.c:77:1: error: expected function body after function declarator
INITFUNC (void)
^
src/sets/sets.c:39:18: note: expanded from macro 'INITFUNC'
#define INITFUNC initsetsc
^
1 error generated.
error: command 'clang' failed with exit status 1
I tried doing this, even thourgh it wasn't the same and exported gcc and g++:
➜ ~ export CC=gcc
➜ ~ export CXX=g++
Running again:
src/sets/sets.c:77:1: error: expected function body after function declarator
INITFUNC (void)
^
src/sets/sets.c:39:18: note: expanded from macro 'INITFUNC'
#define INITFUNC initsetsc
^
1 error generated.
error: command 'gcc' failed with exit status 1
Most who had this issue used sudo apt-get python-dev or something of the like to resolve this issue, I couldn't find an equivalent for Mac. Is there a way to resolve this issue?
Unfortunately it seems that guppy library works only for Python 2.x. An alternative could be objgraph
Try installing the guppy3 fork of guppy that supports Python 3:
pip3 install guppy3
I'm trying to install psycopg2 for use with Django. I'm using a virtualenv and when I try to install psycopg2 I get an error which says:
In file included from psycopg/psycopgmodule.c:27:
./psycopg/psycopg.h:30:10: error: 'Python.h' file not found with <angled> include; use "quotes" instead
#include <Python.h>
^~~~~~~~~~
"Python.h"
In file included from psycopg/psycopgmodule.c:27:
In file included from ./psycopg/psycopg.h:30:
psycopg/Python.h:29:10: fatal error: 'structmember.h' file not found
#include <structmember.h>
^
2 errors generated.
error: command 'clang' failed with exit status 1
I found a few threads online that seemed to suggest that the solution to this problem is to install python-dev. Unfortunately, I've only found it available for apt-get and yum. It's not available for homebrew or macports as for as I know. Can anyone help me figure out either why the installation fails or how I can get psycopg2? Thanks!
EDIT: I'm using a virtualenv and using the postgres app. I have the XCode command line tools installed already.
So it turns out I was wrong about the cause of the problem. It was not because I didn't have the Python headers, it was because I had somehow deleted them all from the homebrew python directory. After some chatting on Freenode's Python channel, a user helped me identify the problem. There were only three files in
/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7
So I ran
brew uninstall python
brew install python
which reinstalled the headers and fixed the problem!
I am trying to install M2Crypto for python on Mint 12. I have executed `python setup.py build, but the build fails, stating
error: command 'gcc' failed with exit status 1
the preceding 2 lines show that there may be a problem with Python.h:
SWIG/_m2crypto_wrap.c:126:20: fatal error: Python.h: No such file or directory
compilation terminated
If anyone knows what needs to be done to fix this, please let me know.
EDIT
I have attempted to install python-dev, but I get the following error:
The following packages have unmet dependencies:
python-dev: Depends: python (= 2.6.6-2ubuntu1) but 2.7.2-7ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages
It looks that you miss the python-dev package which contains python.h
try following command
$sudo apt-get install python-m2crypto
Compiling on recent Debian, Ubuntu or derivatives like Mint gives an error:
ImportError: /usr/local/lib/python2.7/dist-packages/M2Crypto/__m2crypto.so: undefined symbol: SSLv2_method
Corresponding question and answer here.