unable to install matplotlib under pythonw3.3 on mac - python

I am trying to install matplotlib using this command:
pip install matplotlib
I get this error:
src/ft2font.h:16:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
^
1 warning and 2 errors generated.
error: command '/usr/bin/clang' failed with exit status 1
What does this error mean? I am able to install other packages like bumpy etc.
I did a
brew install freetype
I get this error:
Warning: freetype-2.5.2 already installed, it's just not linked
what does this mean?
I have the free type install as shown here:
/usr/local/include/freetype -> /usr/X11/include/freetype2/freetype
I am stuck, any ideas, any body?

I follow the step on this site and it worked:
http://matplotlib.org/faq/installing_faq.html

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.

Installing PyFTGL: distribution not found

I am trying to install PyFTGL, to display text in my OpenGL project.
I usually install libraries using pip, but
sudo pip3 install PyFTGL
returns the following error:
Could not find a version that satisfies the requirement PyFTGL (from versions:)
No matching distribution found for PyFTGL
I also tried easy_install after reading this wiki, but
sudo easy_install PyFTGL
returns the following error:
error: Could not find suitable distribution for Requirement.parse('PyFTGL')
What am I doing wrong ?
I am using python3.6 on my Macbook OSX Yosemite.
EDIT: after installing dependencies (FTGL, freetype, and boost-python) I still seem to miss a library.
I get the following error message when running the python setup.py install command from the source code directory:
ld: library not found for -lGLU
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1
Although I can already do this in python: from OpenGL.GLU import *

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!

PIL Install issues - seems like I may be missing some required libs, but which ones and how to install?

I had an error uploading images on my Python/Django site, and so installed the PIL library (1.1.6 on python 2.4 with CentOS) and also installed the jpeg library using $ sudo yum install freetype freetype-devel jpeg jpeg-devel libpng libpng-devel and the pil library using wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz
After unpacking, and running: python setup.py build_ext -i and sudo python setup.py install
I get an long string of errors, but they end in (previous ones are all about error: expected attribute etc...) :
_imaging.c:3041: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âfunctionsâ
_imaging.c:3138: warning: return type defaults to âintâ
_imaging.c: In function âDL_EXPORTâ:
_imaging.c:3138: error: expected declaration specifiers before âinit_imagingâ
_imaging.c:3149: error: expected â{â at end of input
error: command 'gcc' failed with exit status 1
Please let me know if more of the errors messages are required to properly troubleshoot.

problems installing M2Crypto on Mint

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.

Categories