Matplotlib installation on Mavericks - python

I'm having problem while installing matplotlib. I'm using Mavericks and it complains about a deprecated NumPy API both installing via pip and installing from source (following the instructions here https://github.com/matplotlib/matplotlib/blob/master/README.osx):
In file included from src/_macosx.m:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:76:1: error:
duplicate interface definition for class 'NSObject'
#interface NSObject <NSObject> {
^
/usr/include/objc/NSObject.h:50:12: note: previous definition is here
#interface NSObject <NSObject> {
^
In file included from src/_macosx.m:5:
In file included from /Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1761:
/Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning:
"Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API
NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by " \
^
1 warning and 1 error generated.
error: command 'clang' failed with exit status 1
After that it exists without having completed the installation. I have already installed both libpng and freetype using brew, and I also already have installed both NumPy and SciPy via pip:
numpy==1.8.2
scipy==0.14.0

Ok, I solved the issue also thanks to flebool. In the folder
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
I had both MacOSX10.9.sdk and MacOSX10.8.sdk and I didn't know if they should exists both. I had Mavericks so I thought that maybe MacOSX10.8.sdk could be the problem. I deleted it and I managed to install matplotlib from source succesfully.

Related

How do I install CVXOPT for Python 2.7 on Windows 10?

Ultimately I am trying to install CVXPY for Python 2.7. CVXPY has a few requirements including CVXOPT. I have tried two approaches, installing from Gohlke's website, where he hosts Windows Binaries for Python Extensions: http://www.lfd.uci.edu/~gohlke/pythonlibs/ and building from source myself.
When using the binaries provided from Gohlke, I get the following error when trying to import in python:
import cvxpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
...
File "C:\Python27\Lib\site-packages\cvxpy\interface\cvxopt_interface\dense_matrix_interface.py", line 26, in <module>
import cvxopt
File "C:\Python27\Lib\site-packages\cvxopt\__init__.py", line 32, in <module>
import cvxopt.base
ImportError: DLL load failed: The specified module could not be found.
I have checked that the base.pyd file is present in cvxopt/
When building from source I followed the instructions from the site and when eventually building CVXOPT with python setup.py build --compiler=mingw32 I got the following error:
C:\MinGW\bin\gcc.exe -mdll -O -Wall -Isrc/C/SuiteSparse/AMD/Include -Isrc/C/SuiteSparse/SuiteSparse_config -IC:\Python27\include -IC:\Python27\PC -c src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c -o build\temp.win32-2.7\Release\src\c\suitesparse\suitesparse_config\suitesparse_config.o
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c: In function 'SuiteSparse_tic':
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c:358:21: error: storage size of 't' isn't known
struct timespec t ;
^
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c:359:5: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
clock_gettime (CLOCK_MONOTONIC, &t) ;
^
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c:359:20: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
clock_gettime (CLOCK_MONOTONIC, &t) ;
^
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c:359:20: note: each undeclared identifier is reported only once for each function it appears in
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c:358:21: warning: unused variable 't' [-Wunused-variable]
struct timespec t ;
^
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
I did some research into this and error: storage size of 't' isn't known but i can't determine if it's CVXOPT's fault or Windows?
I'm using Python2.7 on Windows 10. Any suggestions or clarity on some of these issues would be great. Like I mentioned, just trying to get CVXPY working, but seem to be hung up on CVXOPT. Thanks!
UPDATE
I was able to get a working installation of CVXOPT by uninstalling the current numpy version I had and downloading / installing the numpy-mkl whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy. I then installed CVXOPT and CVXPY from the site as well. Finally was able to get a successful import cvxpy without the cvxopt.base DLL error.
Still would be curious about the compilation error I was having.
thank you for this. My 2 cents on this:
With Anaconda on Windows 7 I just used the omnia repo conda install -c omnia cvxopt. It looks like it's working. Will update here if it breaks.

Can't get Pandas to install with OpenShift

I am ssh-ing a Flask application on OpenShift and one of the Python dependencies is Pandas 0.16.1. Looking through the OpenShift documentation, I created my setup.py file as follows:
from setuptools import setup
setup(name='MyApp',
version='0.1a',
description='some description',
author='me',
author_email='me#gmail.com',
url='http://myapp.com/',
install_requires=['Flask>=0.10.1','numpy>=1.9.2','pandas>=0.16.1'],
)
When creating the app using the requires, the process fails. The following error is produced... help!
The initial build for the application failed: Shell command
'/sbin/runuser -s /bin/sh 557ba9e9e0b8cd360b000131 -c "exec
/usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c1,c69' /bin/sh
-c \"gear postreceive --init >> /tmp/initial-build.log 2>&1\""' returned an error. rc=137 .Last 10 kB of build output: Stopping Python
2.7 cartridge Repairing links for 1 deployments Building git ref 'master', commit 239ba5f Activating virtenv Running setup.py script..
running develop running egg_info creating GTFS_Viewer.egg-info writing
requirements to GTFS_Viewer.egg-info/requires.txt writing
GTFS_Viewer.egg-info/PKG-INFO writing top-level names to
GTFS_Viewer.egg-info/top_level.txt writing dependency_links to
GTFS_Viewer.egg-info/dependency_links.txt writing manifest file
'GTFS_Viewer.egg-info/SOURCES.txt' reading manifest file
'GTFS_Viewer.egg-info/SOURCES.txt' writing manifest file
'GTFS_Viewer.egg-info/SOURCES.txt' running build_ext Creating
/var/lib/openshift/557ba9e9e0b8cd360b000131/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/GTFS-Viewer.egg-link
(link to .) Adding GTFS-Viewer 0.1a to easy-install.pth file Installed
/var/lib/openshift/557ba9e9e0b8cd360b000131/app-root/runtime/repo
Processing dependencies for GTFS-Viewer==0.1a Searching for
pandas>=0.16.1 Reading
http://mirror1.ops.rhcloud.com/mirror/python/web/simple/pandas/ Best
match: pandas 0.16.1 Downloading
mirror1.ops.rhcloud.com/mirror/python/web/packages/source/p/pandas/pandas-0.16.1.zip#md5=d465643d588c4f886b8e796ae56673ad
Processing pandas-0.16.1.zip Writing
/tmp/easy_install-97qgiA/pandas-0.16.1/setup.cfg Running
pandas-0.16.1/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-97qgiA/pandas-0.16.1/egg-dist-tmp-VpNuur warning: no
files found matching 'README.rst' no previously-included directories
found matching 'doc/build' warning: no directories found matching
'examples' warning: no previously-included files matching '*.so' found
anywhere in distribution warning: no previously-included files
matching '*.pyd' found anywhere in distribution warning: no
previously-included files matching '*.pyc' found anywhere in
distribution warning: no previously-included files matching '*~' found
anywhere in distribution warning: no previously-included files
matching '#*' found anywhere in distribution warning: no
previously-included files matching '.git*' found anywhere in
distribution warning: no previously-included files matching
'.DS_Store' found anywhere in distribution warning: no
previously-included files matching '*.png' found anywhere in
distribution In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/index.c:250:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" pandas/index.c: In function
'__pyx_f_6pandas_5index_11IndexEngine__maybe_get_bool_indexer':
pandas/index.c:4088: warning: '__pyx_v_last_true' may be used
uninitialized in this function pandas/index.c: In function
'__pyx_f_6pandas_5index_13Float64Engine__maybe_get_bool_indexer':
pandas/index.c:7981: warning: '__pyx_v_last_true' may be used
uninitialized in this function pandas/index.c: In function
'__pyx_f_6pandas_5index_11Int64Engine__maybe_get_bool_indexer':
pandas/index.c:7356: warning: '__pyx_v_last_true' may be used
uninitialized in this function pandas/index.c: In function
'__pyx_f_6pandas_5index__bin_search': pandas/index.c:8769: warning:
'__pyx_v_mid' may be used uninitialized in this function In file
included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime.c:18:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
/opt/rh/python27/root/usr/include/python2.7/datetime.h:188: warning:
'PyDateTimeAPI' defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime_strings.c:17:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
pandas/src/datetime/np_datetime_strings.c: In function
'make_iso_8601_datetime':
pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c: At top level:
pandas/src/datetime/np_datetime_strings.c:127: warning: 'get_gmtime'
defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/period.c:251:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1594:
warning: '_import_array' defined but not used
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:236:
warning: '_import_umath' defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime.c:18:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
/opt/rh/python27/root/usr/include/python2.7/datetime.h:188: warning:
'PyDateTimeAPI' defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime_strings.c:17:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
pandas/src/datetime/np_datetime_strings.c: In function
'make_iso_8601_datetime':
pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c: At top level:
pandas/src/datetime/np_datetime_strings.c:127: warning: 'get_gmtime'
defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from pandas/src/period_helper.h:12, from pandas/src/period_helper.c:1:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
pandas/src/period_helper.c:33: warning: 'NULL_AF_INFO' defined but not
used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/algos.c:250:
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning "Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
I have had the same problem: Installing pandas through requirements.txt or using pip did not work.
Openshift stops and kills the process when trying to compile algos.c. Here is the manual install workaround that did the trick for me (python3.3 cartridge). It is the result of an somewhat tedious try-and-error process, and I cannot really explain why it works. But you might want to give it a try.
Connect to openshift: rhc ssh <appname>.
Download latest pandas source into the /tmp directory to install manually
cd /tmp
mkdir pandas
cd pandas
wget https://pypi.python.org/packages/source/p/pandas/pandas-0.16.2.zip#md5=860a6c7e5e1a24bb0aa549b115830252
unzip pandas-0.16.2.zip
cd pandas-0.16.2
Edit the setup.py file using your favourite (available) editor, e.g. emacs and search for "algos". The second time it appears comment out the algos package in the variable ext_data:
...
index={'pyxfile': 'index',
'sources': ['pandas/src/datetime/np_datetime.c',
'pandas/src/datetime/np_datetime_strings.c']},
# algos={'pyxfile': 'algos',
# 'depends': [srcpath('generated', suffix='.pyx'),
# srcpath('join', suffix='.pyx')]},
parser={'pyxfile': 'parser',
'depends': ['pandas/src/parser/tokenizer.h',
'pandas/src/parser/io.h',
'pandas/src/numpy_helper.h'],
...
Run the first part of the installation procedure:
./setup.py install
Now, let us compile the missing algos piece by hand. To do so, remove the comments you made in step 2, and comment out all other entries (except the algos entry) in ext_data.
Run setup in "dry-run" mode to see the two gcccommands you need to compile algos
./setup.py -n build
Copy the first gcc command to run it from shell. When I tried this, this command made openshift shut down the connection. So, I adjusted it by removing doublicate options and remove the -O2 flag (i.e., the optimization). This worked for me:
gcc -pthread -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/python33/root/usr/include -Ipandas/src/klib -Ipandas/src -I/opt/rh/python33/root/usr/lib64/python3.3/site-packages/numpy/core/include -I$OPENSHIFT_HOMEDIR/python/virtenv/venv/include -I/opt/rh/python33/root/usr/include/python3.3m -c pandas/algos.c -o build/temp.linux-x86_64-3.3/pandas/algos.o
The second command can be run unchanged. For me it was:
gcc -pthread -shared -L/opt/rh/python33/root/usr/lib64 -L/usr/lib6464 build/temp.linux-x86_64-3.3/pandas/algos.o -L/opt/rh/python33/root/usr/lib64 -lpython3.3m -o build/lib.linux-x86_64-3.3/pandas/algos.cpython-33m.so
Now, the hand-made files need to be installed:
./setup.py install
Quick check if it worked for you. First cd to your home directory, then try python:
cd
python
Python 3.3.2 (default, Mar 20 2014, 20:25:51)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Delete the /tmp/pandas directory.
rm -rf /tmp/pandas
Hope this works for you, too!
Can you do that manually ? i.e :
ssh 12hh3456789hh01011#nameofapp-username.rhcloud.com
And activate the environment :
source app-root/runtime/dependencies/python/virtenv/bin/activate
And then install the dependencies. First Numpy
pip install -U numpy
And then Pandas:
pip install pandas
Restart Openshift Application from web console and commit the changes and deploy. it worked for me!

python monary 0.2.3 (mongo monary driver): error in setup on windows 64bit (Anaconda distribution)

I read about python+mongo+monary is extremly fast for numpy panda processing working with mongodb on
Alex Gaudio's blog http://alexgaudio.com/2012/07/07/monarymongopandas.html
I am trying to install monary driver, which i picked up from
https://pypi.python.org/pypi/Monary on windows 64 bit. I have Ananconda python 2.7 distribution.
python ./setup.py install
I am getting following conflict error.
monary/cmonary.c:46:20: error: conflicting types for 'OBJECTID'
In file included from e:\anaconda\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/
../../../../x86_64-w64-mingw32/include/windef.h:137:0,
from e:\anaconda\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/
../../../../x86_64-w64-mingw32/include/windows.h:59,
from mongodb-mongo-c-driver-74cc0b8/src/mongo.h:25,
from monary/cmonary.c:8:
e:\anaconda\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64
-mingw32/include/winnt.h:457:5: note: previous declaration of 'OBJECTID' was her
e
monary/cmonary.c: In function 'monary_load_timestamp_value':
monary/cmonary.c:247:9: warning: dereferencing type-punned pointer will break st
rict-aliasing rules [-Wstrict-aliasing]
monary/cmonary.c: In function 'monary_load_query':
monary/cmonary.c:519:9: warning: unused variable 'total_values' [-Wunused-variab
le]
error: command 'E:\\Anaconda\\Scripts\\gcc.bat' failed with exit status 1
I can change all all reference of OBJECTID in monary to something like BOBJECTID and get rid of re-definition or undef OBJECTID before, I dont know the side effects of same? looking for an answer or a windows install of Monary
You need to have MinGW installed (http://www.mingw.org/) and use it to install gcc. Then you need to add C:\MinGW\bin (or whatever your install path is) to your PATH variable like in this answer:
libgmp-10.dll is missing

Error with PyML build

I'm looking to start a Machine Learning project, and I attempted to install PyML (on Mac OS X 10.6.8). In doing so I received the following error while running python setup.py build.
PyML/containers/ext/SparseDataSet_wrap.cpp: At global scope:
PyML/containers/ext/SparseDataSet_wrap.cpp:17658: fatal error: error writing to -: Broken pipe
compilation terminated.
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
PyML/containers/ext/SparseDataSet_wrap.cpp: In static member function ‘static Type swig::traits_as<Type, swig::value_category>::as(PyObject*, bool) [with Type = float]’:
PyML/containers/ext/SparseDataSet_wrap.cpp:3341: warning: ‘v’ may be used uninitialized in this function
PyML/containers/ext/SparseDataSet_wrap.cpp: In static member function ‘static Type swig::traits_as<Type, swig::value_category>::as(PyObject*, bool) [with Type = int]’:
PyML/containers/ext/SparseDataSet_wrap.cpp:3341: warning: ‘v’ may be used uninitialized in this function
lipo: can't open input file: /var/folders/BB/BB-0UcDKHzKgl2HboGzXqU+++TI/-Tmp-//ccf93ouC.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
I followed the following tutorial for the install process:
http://pyml.sourceforge.net/tutorial.html
Any suggestions on what might be causing it and how to fix it? Thanks.
I also had precisely the same problem using PyML on Ubuntu.
Installing the Python development package (python2.x-dev) resolved the issue. You need to install those Python development headers, installing XCode should also install the headers on Mac.
They are usually located in "/System/Library/Frameworks/Python.framework/Versions/2.6/"

Problem installing Shoutpy + Boost.python on opensolaris

Im trying to install shoutpy on opensolaris 2009.6. It relies on boost.python. i've installed the boost_devel libraries from blastwave and linked /opt/csw/include/boost to /usr/include/boost . But when I try to easy_install shoutpy I get the following output
munderwo#opensolaris-test1:/usr/include$ pfexec easy_install shoutpy
Searching for shoutpy
Reading http://pypi.python.org/simple/shoutpy/
Reading http://dingoskidneys.com/shoutpy/
Best match: shoutpy 1.0.0
Downloading http://dingoskidneys.com/shoutpy/shoutpy-1.0.0.tar.gz
Processing shoutpy-1.0.0.tar.gz
Running shoutpy-1.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-w7XQfv/shoutpy-1.0.0/egg-dist-tmp-k11Dky
In file included from /usr/include/boost/python/object/make_instance.hpp:9,
from /usr/include/boost/python/object/make_ptr_instance.hpp:8,
from /usr/include/boost/python/to_python_indirect.hpp:11,
from /usr/include/boost/python/converter/arg_to_python.hpp:10,
from /usr/include/boost/python/call.hpp:15,
from /usr/include/boost/python/object_core.hpp:12,
from /usr/include/boost/python/args.hpp:25,
from /usr/include/boost/python.hpp:11,
from shoutpy.cc:26:
/usr/include/boost/python/object/instance.hpp:44: error: a casts to a type other than an integral or enumeration type cannot appear in a constant-expression
/usr/include/boost/python/object/instance.hpp:44: error: '->' cannot appear in a constant-expression
/usr/include/boost/python/object/instance.hpp:44: error: `&' cannot appear in a constant-expression
In file included from /usr/include/boost/python/converter/registry.hpp:9,
from /usr/include/boost/python/converter/registered.hpp:8,
from /usr/include/boost/python/object/make_instance.hpp:10,
from /usr/include/boost/python/object/make_ptr_instance.hpp:8,
from /usr/include/boost/python/to_python_indirect.hpp:11,
from /usr/include/boost/python/converter/arg_to_python.hpp:10,
from /usr/include/boost/python/call.hpp:15,
from /usr/include/boost/python/object_core.hpp:12,
from /usr/include/boost/python/args.hpp:25,
from /usr/include/boost/python.hpp:11,
from shoutpy.cc:26:
/usr/include/boost/python/converter/rvalue_from_python_data.hpp:99: error: '->' cannot appear in a constant-expression
/usr/include/boost/python/converter/rvalue_from_python_data.hpp:99: error: `&' cannot appear in a constant-expression
/usr/include/boost/python/converter/rvalue_from_python_data.hpp:99: error: template argument 1 is invalid
/usr/include/boost/python/converter/rvalue_from_python_data.hpp:99: error: `value' is not a member of `<declaration error>'
error: Setup script exited with error: command '/usr/lib/python2.6/pycc' failed with exit status 1
This is using python2.6, opensolaris 2009.06, boost 1.35.
any help would be great!
Cheers
Mark
Edit - this has been cross posted on serverfault as its a bit hard to classify where the problem domain is. https://serverfault.com/questions/88724/problem-with-opensolaris-boost-python-and-shoutpy
Unfortunately I've never tried to compile shoutpy under OpenSolaris and I don't use it these days. Boost.python requires a lot from its C++ compiler. Use easy_install -b build_directory shoutpy so it'll keep the source code after it fails, then check the C++ compiler Python tries to use against those supported by boost.python.
I tried compiling it on my desktop Linux and it still works after I edit setup.py to link against libboost_python-mt instead of libboost_python which doesn't exist in Ubuntu (there are several libboost_python* depending on Python version and so forth).

Categories

Resources