Matplotlib installation on Mavericks

2024/9/22 5:28:49

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_APINPY_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
Answer

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.

https://en.xdnf.cn/q/119095.html

Related Q&A

Exact string search in XML files?

I need to search into some XML files (all of them have the same name, pom.xml) for the following text sequence exactly (also in subfolders), so in case somebody write some text or even a blank, I must …

Integrate a function by the trapezoidal rule- Python

Here is the homework assignment Im trying to solve:A further improvement of the approximate integration method from the last question is to divide the area under the f(x) curve into n equally-spaced tr…

Kivy module not found in vscode (Mac)

I have installed Kivy and when I used the IDLE app that came with Python I can import it and it runs perfectly. However, when I try to import it in vscode I get the error: ModuleNotFoundError: No modul…

How to get latest unique entries from sqlite db with the counter of entries via Django ORM

I have a SQLite db which looks like this:|ID|DateTime|Lang|Details| |1 |16 Oct | GB | GB1 | |2 |15 Oct | GB | GB2 | |3 |17 Oct | ES | ES1 | |4 |13 Oct | ES | ES2 | |5 |15 Oct | ES | ES3 …

What does this code %.8f% do in python? [duplicate]

This question already has answers here:What does % do to strings in Python? [duplicate](4 answers)Closed 6 years ago.I am editing a code line to pass the rate in quotes:OO000OO00O0O0O000 [rate]=O0O0OO…

How to append a selection of a numpy array to an empty numpy array

I have a three .txt files to which I have successfully made into a numpy array. If you are curious these files are Level 2 data from the Advanced Composition Experiment (ACE). The particular files are …

Error saving and loading a list of matrices

I have a list "data_list", and I would save it in order to load it in another script. First of all I converted it in an array, in this way:data_array = np.array(data_list)Then I saved it:np.s…

Trying to interact with HTML page elements, but none of them are found

Im trying to scrape a webpage using Selenium, but when I try to pass the XPath of a button, I get an error saying that this element does not exist. I tried with another website, and it worked perfectly…

Duplicating an XML element and adding it to a specific position in XML file using python

I have a xml file in which content looks like this: xml_content_to_search = <Document ProviderID="TD" DecimalMarker="comma" Website="https://erc-viewer.sap.com/"> &l…

How do I fix this Gets server error, which is causing display issues?

The list in the left column of ontariocourts311.ca, along with the body of the page under the image intermittently fail to display (which is fixed by refreshing the page). Im a Noob, and have tried var…