problems installing M2Crypto on Mint - python

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.

Related

pip install pyaudio gcc error "function declaration isn’t a prototype"

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.

swig/sphinxbase/ad.i:56: Error: Unable to find 'pybuffer.i'

I have been trying to install the pocketsphinx package
with pip for python3.6.3 on Mac os x 10.6.8 but the package failed to install an I get these errors:
swig/sphinxbase/ad.i:56: Error: Unable to find 'pybuffer.i'
swig/sphinxbase/ad.i:99: Error: Unable to find 'pybuffer.i'
error: command 'swig' failed with exit status 1.
I already have swig installed. I don't know what the problem is or even worst how to solve it. Thank you!.

'sqlite3.h': No such file or directory

I am attempting to install the pysqlite module for Python 2.7 on my Windows 10 computer. I issued the following command:
pip install pysqlite
The installation ran as usual until it hit an error:
c:\users\xaresys\appdata\local\temp\pip-build-xleoab\pysqlite\src\connection.h(33) : fatal error C1083: Cannot open include file: 'sqlite3.h': No such file or directory
error: command 'C:\Users\xaresys\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
I also tried to install a similar module, pysqlcipher, which hit the same error. Do I need to install anything before installing this? Thanks.
Looks like you are missing Visual C++ binaries which are required to install some packages. Follow instructions here: https://github.com/develersrl/gccwinbinaries

Can't find a way to install python-dev on Mac OS X

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!

Error installing psycopg on OSX (yosemite) using PIP

I'm getting a strange linker error that I don't completely understand while attempting to install postgresql on OSX.
I've installed Postgres via Brew and now I'm trying to get my Django app up and running. I've added the postgres directory to my path. I'm running OSX Yosemite.
When I run the following command:
pip install psycopg2
I get this error:
ld: illegal text reloc in '_init_psycopg' to '_lobjectType' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1
I'm at a loss where to go from here and my searches for this type of error has lead me no where. Any help would be amazing.
Thanks.
Turns out I had a couple versions of Postgres installed. I had to remove the old one and make sure the pg_config that was found in the PATH was the most recent one. As soon as I made sure the pg_config was the proper one, this error went away.

Categories