WebFaction
Community site: login faq

[i found an earlier attempt to install matplotlib @ WebFaction going back to 2007, but i seem to be bumping into something newer.]

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/usr/include -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/usr/local/lib/python2.7/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/usr/local/include/python2.7 -c src/backend_agg.cpp -o build/temp.linux-i686-2.7/src/backend_agg.o

src/backend_agg.cpp: In member function ‘Py::Object RendererAgg::write_rgba(const Py::Tuple&)’:

src/backend_agg.cpp:2050: error: ‘npy_PyFile_Dup’ was not declared in this scope

src/backend_agg.cpp:2054: error: ‘npy_PyFile_DupClose’ was not declared in this scope

src/backend_agg.cpp:2064: error: ‘npy_PyFile_DupClose’ was not declared in this scope

/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h: At global scope:

/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h:330: warning: ‘void simple_capsule_dtor(void*)’ defined but not used

error: command 'gcc' failed with exit status 1

this seems a npy_3k issue (ie, having to do with Python3?!). and since numpy seems part of the basic WF install:

[<myUser>@web80 django]$ python
Python 2.7.3 (default, Jun 11 2012, 22:26:11) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__path__
['/usr/local/lib/python2.7/site-packages/numpy']

maybe there's a way to simply point pip at these libraries?

has anyone successfully installed matplotlib on WF lately?

asked 17 May '13, 14:05

rikEA
2326
accept rate: 0%

edited 20 May '13, 15:23


matplotlib-1.2.1 doesn't seem to like our system numpy-1.5 for some reason.

I tested this in my own home directory on your server and found that I was able to install matplotlib-1.2.1 if I first upgraded numpy, eg:

pip install -I -U --user numpy
pip install matplotlib

The first command pulled in numpy 1.7.1, and matplotlib built against that with no complaints.

Hope that helps!

permanent link

answered 17 May '13, 19:52

seanf
12.2k42136
accept rate: 37%

thanks for checking into this Sean. but i did what you recommended (including both -I and -U options for numpy's installation; but aren't these contradictory?), and it fails at just the same point.

note that i'm following the recommendations in your python installation instructions for webapps so my actual commands are like:

pip-2.7 install --install-option="--install-scripts=/home/<myUser>/webapps/django/bin" --install-option="--install-lib=/home/<myUser>/webapps/django/lib/python2.7" -I -U --user numpy

pip-2.7 install --install-option="--install-scripts=/home/<myUser>/webapps/django/bin" --install-option="--install-lib=/home/<myUser>/webapps/django/lib/python2.7" matplotlib

could that be the difference?

(20 May '13, 15:22) rikEA

Regarding -I and -U, I used -I to try to convince pip to ignore the system-wide installation of numpy. Maybe that wasn't necessary.

In my example, I was installing into ~/lib/python2.7 and it worked with no problem.

To make this installation work for a ~/webapps/<app>/lib/python2.7 installation, I had to do two things differently:

  • The numpy installation seemed to take issue with the system /tmp directory, and ..
  • The matplotlib installation seemed to ignore the ~/webapps/<app>/lib/python2.7 directory. I expect this is due to some quirk in the matplotlib build procedure that invokes Python in a way that causes it to ignore the systemwide sitecustomize.py that makes the ~/webapps/<app>/lib/python2.7 magic happen.

Here are the steps I took to work around both of those issues:

mkdir ~/tmp
export TMPDIR=~/tmp
cd ~/webapps/django
pip-2.7 install --install-option="--install-scripts=/home/<myUser>/webapps/django/bin" --install-option="--install-lib=/home/<myUser>/webapps/django/lib/python2.7" -U --user numpy
PYTHONPATH=$PWD/lib/python2.7 pip-2.7 install --install-option="--install-scripts=/home/<myUser>/webapps/django/bin" --install-option="--install-lib=/home/<myUser>/webapps/django/lib/python2.7" matplotlib

I hope that helps - please let me know if you need anything else.

(20 May '13, 19:10) seanf

yes, that worked. i had to get schooled on the requirement that PYTHONPATH=$PWD/lib/python2.7 has to be on the same line as the pip-2.7 install ... command, but then it went thru. it threw a bunch of warnings:

#warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"

but hey, they're only warnings:)

thanks to Sean and all the other great WF support.

(21 May '13, 11:42) rikEA

The solution here didn't work for me: when I try to run the commands to install numpy, either way, it dies at the end because it tries to uninstall the system-wide numpy 1.5. What am I doing wrong? I'm actually trying to install matplotlib and pandas, which is failing as well.

permanent link

answered 02 Jun '13, 09:03

tclancy
861815
accept rate: 6%

Did you set the options as per seanf's comment on the first answer? This will ensure that pip looks at your specific installation. If it's still not working after that then please log a support ticket from your control panel and we can look into it further for you.

(02 Jun '13, 19:30) waynek

I did. It turned out I had an old version of pip (1.0.1), which must not have known about the flags.

(03 Jun '13, 09:58) tclancy

Coming back to this as I ran into a different issue with new versions of pip (1.5) where it complains you need a newer version of setuptools (wants 0.8 or better). for that, try pip install setuptools --no-use-wheel --upgrade --user then run the numpy install suggested above.

(10 Jan '14, 22:08) tclancy
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×54
×44
×7
×5

question asked: 17 May '13, 14:05

question was seen: 4,942 times

last updated: 10 Jan '14, 22:08

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM