matplotlib and numpy install errors

1,347 views
Skip to first unread message

Bio

unread,
Jun 28, 2011, 7:30:28 PM6/28/11
to nltk-users
Hello, I am trying to install matplotlib and numpy on a new Mac. I had
no difficulty downloading and installing PyYAML and NLTK. Python 2.6
came already installed on the system. I was able to download both
matplotlib and numpy without difficulty however when I try to install
either of them I get the error message:

matplotlib 1.01.1-r0 can't be installed on this disk
matplotlib requires System Python 2.6 to install

I get the same error message when I try to install numpy

I have verified that I do have one version of Python only and it is
2.6.1. Does anybody have any idea how to resolve this problem? Thanks,
George

Richard Careaga

unread,
Jun 28, 2011, 8:44:01 PM6/28/11
to nltk-...@googlegroups.com
here are my suggestions: http://www.richard-careaga.com/archives/3474



Bio
June 28, 2011 7:30 PM

Bio

unread,
Jun 28, 2011, 9:12:13 PM6/28/11
to nltk-users
Hi Richard, Thank you for your reply. I have to admit I am extremely
reluctant to install a second version of Python on my system. When I
originally set up nltk on my previous Mac I unknowingly installed a
second version of Python before I tried to install nltk. It took a lot
of work to get the system to work and I still have problems because of
that dual Python install. What I am hoping to do is install numpy and
matplotlib with just the single Python 2.6.1 on my system without
having to install 2.7.1 as well. If I understood your post you are
recommending doing a Python 2.7.1 install before installing numpy and
matplotlib. Is it possible to install numpy and matplotlib with 2.6.1?
I did an easy_install and numpy seemed to install although there were
some error messages, the matplotlib did seem to easy_install at all.
Sincerely, George

On Jun 28, 8:44 pm, Richard Careaga <leuc...@gmail.com> wrote:
> here are my suggestions:http://www.richard-careaga.com/archives/3474
>
>
>
> > ------------------------------------------------------------------------
>
> >    Bio <mailto:Sel...@BioASys.net>

Richard Careaga

unread,
Jun 28, 2011, 11:23:42 PM6/28/11
to nltk-...@googlegroups.com
I see that there's a new version of matplotlib since my note and it appears that the "matplotlib requires System Python 2.6 to install" message in your case comes from the mkpg. What I'd suggest is to try

easy_install matplotlib

(which might require sudo, always a worry) and you'll need to mess with your PYTHONPATH to make sure you have things right.

If that get's you past the 'requires 2.6 to install' and matplotlib examples work, you're done. If, however, you still have problems check  step 7 from the link for the corrections that need to be made to matplotlib 0.91 to see if they apply to this version.

I'd still give consideration to doing the 2.7.1 thing, though; I've found it much easier to manage Python packages by having them under /usr/local in general and using virtualenv keeps you even more organized. Do not, however, touch the system 2.6 or you'll have no end of grief. The brew method will save you from that.


Bio
June 28, 2011 9:12 PM

Hi Richard, Thank you for your reply. I have to admit I am extremely
reluctant to install a second version of Python on my system. When I
originally set up nltk on my previous Mac I unknowingly installed a
second version of Python before I tried to install nltk. It took a lot
of work to get the system to work and I still have problems because of
that dual Python install. What I am hoping to do is install numpy and
matplotlib with just the single Python 2.6.1 on my system without
having to install 2.7.1 as well. If I understood your post you are
recommending doing a Python 2.7.1 install before installing numpy and
matplotlib. Is it possible to install numpy and matplotlib with 2.6.1?
I did an easy_install and numpy seemed to install although there were
some error messages, the matplotlib did seem to easy_install at all.
Sincerely, George



Richard Careaga
June 28, 2011 8:44 PM

June 28, 2011 7:30 PM

Correa Denzil

unread,
Jun 29, 2011, 2:49:26 AM6/29/11
to nltk-...@googlegroups.com
I suggest using the Enthought Python Distribution which bundles up everything : http://www.enthought.com/products/epd.php

--Regards,
Denzil




On Wed, Jun 29, 2011 at 8:53 AM, Richard Careaga <leu...@gmail.com> wrote:



Victor Miclovich

unread,
Jun 29, 2011, 8:34:16 AM6/29/11
to nltk-...@googlegroups.com
Hey Bio,
try to download the numpy source build and compile (on extraction, the following steps should be enough)
$ cd <extracted_numpy_folder>
$ ./configure
$ make
$ sudo make install

If that doesn't help, use macports (a dmg is available for macports installation)
$ sudo port install python-numpy

a dependency tree is built up for other libraries used by matplotlib such as ATLAS, BOOST, etc.

I hope that helps...

> --
> You received this message because you are subscribed to the Google Groups "nltk-users" group.
> To post to this group, send email to nltk-...@googlegroups.com.
> To unsubscribe from this group, send email to nltk-users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nltk-users?hl=en.
>

Bio

unread,
Jun 29, 2011, 1:47:34 PM6/29/11
to nltk-users
Hi Richard, Thank you for your response. Unfortunately I am still
unable to get working versions of numpy or matplotlib. When I perform
an easy_install for both numpy and matplotlib the install proceeds but
several error messages occur. Then when I try to use matplotlib I get
error messages indicating the matplotlib is not present. Here is the
output I get when I try to use matplotlib:

>>> text4.dispersion_plot(["citizens", "democracy", "freedom", "duties", "America"])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.6/site-packages/nltk/text.py", line 461, in
dispersion_plot
dispersion_plot(self, words)
File "/Library/Python/2.6/site-packages/nltk/draw/dispersion.py",
line 25, in dispersion_plot
raise ValueError('The plot function requires the matplotlib
package (aka pylab).'
ValueError: The plot function requires the matplotlib package (aka
pylab).See http://matplotlib.sourceforge.net/


I also tried to use step 7 from your link but I couldn't get terminal
to accept any of the commands you cite. Here is my terminal output
from the first cd command you cite:

Last login: Wed Jun 29 13:33:06 on ttys000
George-Ortons-Mac-Pro:~ BioASys$ cd /usr/local/Cellar/python/2.6.1/lib/
python2.6/site-packages/matplotlib/numerix/ma
-bash: cd: /usr/local/Cellar/python/2.6.1/lib/python2.6/site-packages/
matplotlib/numerix/ma: No such file or directory
George-Ortons-Mac-Pro:~ BioASys$


So unfortunately I am at a loss on how to proceed. Thanks again,
George

Bio

unread,
Jun 29, 2011, 1:49:39 PM6/29/11
to nltk-users
Hi Correa, Thanks for your response. I checked out the link you
provided but frankly I couldn't make heads or tails out of it.
Sincerely, George

On Jun 29, 2:49 am, Correa Denzil <mcen...@gmail.com> wrote:
> I suggest using the Enthought Python Distribution which bundles up
> everything :http://www.enthought.com/products/epd.php
>
> --Regards,
> Denzil
>
>
>
> On Wed, Jun 29, 2011 at 8:53 AM, Richard Careaga <leuc...@gmail.com> wrote:

Richard Careaga

unread,
Jun 29, 2011, 1:55:49 PM6/29/11
to nltk-...@googlegroups.com
You wouldn't find the site package with

-bash: cd: /usr/local/Cellar/python/2.6.1/lib/python2.6/site-packages/
 
unless you installed 2.6.1 there using brew. One of the huge headaches with the system install is knowing where to find site-packages. Try

/Library/Python/2.6/site-packages

However, that may not be what's throwing your

ValueError: The plot function requires the matplotlib package (aka
pylab).See http://matplotlib.sourceforge.net/

if you are using matplotlib 1.01

I tried installing that and got the message and got as far further as a message indicating "wrong architecture" when I threw up my hands and reverted to 0.99. Unfortunately, I don't know how to retrieve that version from the official site.





Bio
June 29, 2011 1:47 PM

Hi Richard, Thank you for your response. Unfortunately I am still
unable to get working versions of numpy or matplotlib. When I perform
an easy_install for both numpy and matplotlib the install proceeds but
several error messages occur. Then when I try to use matplotlib I get
error messages indicating the matplotlib is not present. Here is the
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.6/site-packages/nltk/text.py", line 461, in
dispersion_plot
dispersion_plot(self, words)
File "/Library/Python/2.6/site-packages/nltk/draw/dispersion.py",
line 25, in dispersion_plot
raise ValueError('The plot function requires the matplotlib
package (aka pylab).'
ValueError: The plot function requires the matplotlib package (aka
pylab).See http://matplotlib.sourceforge.net/


I also tried to use step 7 from your link but I couldn't get terminal
to accept any of the commands you cite. Here is my terminal output
from the first cd command you cite:

Last login: Wed Jun 29 13:33:06 on ttys000
George-Ortons-Mac-Pro:~ BioASys$ cd /usr/local/Cellar/python/2.6.1/lib/
python2.6/site-packages/matplotlib/numerix/ma
-bash: cd: /usr/local/Cellar/python/2.6.1/lib/python2.6/site-packages/
matplotlib/numerix/ma: No such file or directory
George-Ortons-Mac-Pro:~ BioASys$


So unfortunately I am at a loss on how to proceed. Thanks again,
George



Richard Careaga
June 28, 2011 11:23 PM

Correa Denzil

unread,
Jun 29, 2011, 1:56:39 PM6/29/11
to nltk-...@googlegroups.com
There's very little to make sense. You can easily navigate the site and read around a little bit especially the FAQ's : http://www.enthought.com/products/epdfaq.php#EPDvsETS

An academic version of EPD is available for free download here: http://www.enthought.com/products/edudownload.php

It contains bundles of most python packages including numpy and matplot lib. Give it a shot.

--Regards,
Denzil

Bio

unread,
Jun 29, 2011, 2:02:00 PM6/29/11
to nltk-users
Hi Victor, Thanks for your response. I tried to implement your first
suggestion but unfortunately could not get past the first step. I
don't really have an extracted numpy folder, it is during the
extraction process that I encounter the error message indicating I
have to have Python 2.6 to proceed. If I try the cd command with the
unextracted numpy location I just get an error: Here is my attempt:

Last login: Wed Jun 29 13:44:23 on ttys000
George-Ortons-Mac-Pro:~ BioASys$ cd /Users/BioASys/Downloads/
matplotlib-1.0.1-python.org-py2.6-macosx10.3.dmg
-bash: cd: /Users/BioASys/Downloads/matplotlib-1.0.1-python.org-py2.6-
macosx10.3.dmg: Not a directory
George-Ortons-Mac-Pro:~ BioASys$


So I am not sure how to proceed further with your first suggestion.
When I try your second suggestion I also get an error message. I do
have MacPorts on my system. Here is the output I get when i try to do
the macports install:

George-Ortons-Mac-Pro:~ BioASys$ sudo port install python-numpy
Password:
Error: Port python-numpy not found
To report a bug, see <http://guide.macports.org/#project.tickets>
George-Ortons-Mac-Pro:~ BioASys$


Thank you for the suggestions but unfortunately I still can't seem to
install numpy or matplotlib on my system. What seems particularly odd
to me is that the error message I get when I try to install either
numpy or matplotlib is that Python 2.6 needs to be present for the
installs to proceed and I do in fact have Python 2.6 and only Python
2.6 on my system. Thanks again for your help. Sincerely, George

Bio

unread,
Jun 29, 2011, 2:12:46 PM6/29/11
to nltk-users
Hi Correa, I've looked through the site but I still don't get most of
it. It looks like I would be downloading an additional (2.7.1) version
of Python along with several other packages. I am extremely hesitant
to download and install an additional version of Python on my system.
I accidentally did that on my old mac and had no end to the problems
it caused me. Am I correct in believing that if I do the enthought
download that I will be installing a second Python 2.7.1 on my system?
Thanks for your help. Sincerely, George

Richard Careaga

unread,
Jun 29, 2011, 2:13:53 PM6/29/11
to nltk-...@googlegroups.com
George, you may not be able to dig yourself out of this hole with the
tools you have. You can't change directories thusly

-bash: cd: /Users/BioASys/Downloads/matplotlib-1.0.1-python.org-py2.6-macosx10.3.dmg

because the file

matplotlib-1.0.1-python.org-py2.6-macosx10.3.dmg

is a disk image, which is not mounted as a directory until you do so
explicitly. MacPorts is not the right tool to install Python packages;
you need easy_install.

Everyone has to go through the Unix 101 learning curve and it's no rap
on you that you haven't yet, but until you do getting to the bottom of
why programs or packages won't install correctly is going to be a never
ending series of frustrations and getting lost.

When I figure out how to install 1.0.1, I'll update my recipe, but that
probably won't be until after I get back to actively using nltk this
fall. In the meantime, the best advice I can offer is to stay away from
the command line and use pre-fab packages like the one Denzil
recommends. You'll still need to know how to set your shell environment
variables so that the install has the correct PYTHONPATH, however.

I wish I could be more helpful.


Correa Denzil

unread,
Jun 29, 2011, 2:16:29 PM6/29/11
to nltk-...@googlegroups.com


--Regards,
Denzil




On Wed, Jun 29, 2011 at 11:42 PM, Bio <Sel...@bioasys.net> wrote:
Hi Correa, I've looked through the site but I still don't get most of
it. It looks like I would be downloading an additional (2.7.1) version
of Python along with several other packages. I am extremely hesitant
to download and install an additional version of Python on my system.
I accidentally did that on my old mac and had no end to the problems
it caused me. Am I correct in believing that if I do the enthought
download that I will be installing a second Python 2.7.1 on my system?

Yes and it's recommended. I have used it myself and vouch for it.
 
Thanks for your help. Sincerely, George

On Jun 29, 1:56 pm, Correa Denzil <mcen...@gmail.com> wrote:
> There's very little to make sense. You can easily navigate the site and read
> around a little bit especially the FAQ's :http://www.enthought.com/products/epdfaq.php#EPDvsETS
>
> An academic version of EPD is available for free download here:http://www.enthought.com/products/edudownload.php
>
> It contains bundles of most python packages including numpy and matplot lib.
> Give it a shot.
>
> --Regards,
> Denzil
>
>
>
> On Wed, Jun 29, 2011 at 11:19 PM, Bio <Sel...@bioasys.net> wrote:
> > provided but frankly I couldn't make heads or tails out of it.

bspr...@me.com

unread,
Jun 29, 2011, 2:18:19 PM6/29/11
to nltk-users
For what it's worth, I'm having exactly the same problem -- same two
error messages (exc. for different path) -- even though matplotlib,
numpy, and nltk are in the same directory and I've imported each of
them. I did have to do a sys.path.append() to get Python to admit the
modules exist, which is a bit odd given that they're in the site-
packages for the 2.7 version that's running, and the old 2.6 version
is *not* in the path at all. --- Bill S.

On Jun 29, 1:47 pm, Bio <Sel...@BioASys.net> wrote:
> Hi Richard, Thank you for your response. Unfortunately I am still
> unable to get working versions of numpy or matplotlib. When I perform
> an easy_install for both numpy and matplotlib the install proceeds but
> several error messages occur. Then when I try to use matplotlib I get
> error messages indicating the matplotlib is not present. Here is the
> output I get when I try to use matplotlib:
>
> >>> text4.dispersion_plot(["citizens", "democracy", "freedom", "duties", "America"])
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/Library/Python/2.6/site-packages/nltk/text.py", line 461, in
> dispersion_plot
>     dispersion_plot(self, words)
>   File "/Library/Python/2.6/site-packages/nltk/draw/dispersion.py",
> line 25, in dispersion_plot
>     raise ValueError('The plot function requires the matplotlib
> package (aka pylab).'
> ValueError: The plot function requires the matplotlib package (aka
> pylab).Seehttp://matplotlib.sourceforge.net/

Bio

unread,
Jun 29, 2011, 2:27:17 PM6/29/11
to nltk-users
Hi everyone, Thank you for all your suggestions. I think at this point
I am going to forgo installing numpy and matplotlib on my system.
Thanks Again, George

Richard Careaga

unread,
Jun 29, 2011, 4:09:25 PM6/29/11
to nltk-...@googlegroups.com
Try setting your PYTHONPATH variable to point to the 2.7 site packages directory if you can't import



bspr...@me.com
June 29, 2011 2:18 PM

For what it's worth, I'm having exactly the same problem -- same two
error messages (exc. for different path) -- even though matplotlib,
numpy, and nltk are in the same directory and I've imported each of
them. I did have to do a sys.path.append() to get Python to admit the
modules exist, which is a bit odd given that they're in the site-
packages for the 2.7 version that's running, and the old 2.6 version
is *not* in the path at all. --- Bill S.

Bio
June 29, 2011 1:47 PM
Hi Richard, Thank you for your response. Unfortunately I am still
unable to get working versions of numpy or matplotlib. When I perform
an easy_install for both numpy and matplotlib the install proceeds but
several error messages occur. Then when I try to use matplotlib I get
error messages indicating the matplotlib is not present. Here is the
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.6/site-packages/nltk/text.py", line 461, in
dispersion_plot
dispersion_plot(self, words)
File "/Library/Python/2.6/site-packages/nltk/draw/dispersion.py",
line 25, in dispersion_plot
raise ValueError('The plot function requires the matplotlib
package (aka pylab).'
ValueError: The plot function requires the matplotlib package (aka



I also tried to use step 7 from your link but I couldn't get terminal
to accept any of the commands you cite. Here is my terminal output
from the first cd command you cite:

Last login: Wed Jun 29 13:33:06 on ttys000
George-Ortons-Mac-Pro:~ BioASys$ cd /usr/local/Cellar/python/2.6.1/lib/
python2.6/site-packages/matplotlib/numerix/ma
-bash: cd: /usr/local/Cellar/python/2.6.1/lib/python2.6/site-packages/
matplotlib/numerix/ma: No such file or directory
George-Ortons-Mac-Pro:~ BioASys$


So unfortunately I am at a loss on how to proceed. Thanks again,
George



Richard Careaga
June 28, 2011 11:23 PM

Dmitry Gorbachev

unread,
Jun 29, 2011, 10:21:18 PM6/29/11
to nltk-...@googlegroups.com
I also wanted to install nltk. Actually I did this on the prebuilt Mac python
5.3 or something. I downloaded nltk modules via nltk.download() OK.
Then I tried to run: from nltk.book import *
I was getting errors right away. The stupidest thing is that I even cannot show
them.

What happened is that I read somewhere that errors might happen because the
version is not 2.6

So, I downloaded and run installation file for python2.6

I am now getting

Last login: Mon Jun 27 19:11:13 on ttys000
ool-4a597042:~ DMITRY$ python
dyld: unknown required load command 0x80000022
Trace/BPT trap
ool-4a597042:~ DMITRY$


I appreciate if someone could shed light on this.

Regards


Dmitry

--

Correa Denzil

unread,
Jun 30, 2011, 5:22:09 AM6/30/11
to nltk-...@googlegroups.com
Dmitry :

I have made this suggestion earlier in the thread. Please use Enthought's Python Distribution(EPD).

--Regards,
Denzil

Bill Spruiell

unread,
Jul 3, 2011, 12:11:25 PM7/3/11
to nltk-users
Just seconding the suggestion: EPD does get around the problem nicely.
I had to manually move the nltk package to the directory EPD wanted,
but that took all of 2 seconds (and I probably could have avoided that
by re-installing nltk).

Bill S.

On Jun 30, 5:22 am, Correa Denzil <mcen...@gmail.com> wrote:
> Dmitry :
>
> I have made this suggestion earlier in the thread. Please use Enthought's
> Python Distribution(EPD).
>
> --Regards,
> Denzil
>

Craig Hagerman

unread,
Jul 3, 2011, 1:10:30 PM7/3/11
to nltk-...@googlegroups.com
Don't you have to pay for EPD?

Craig

Richard Careaga

unread,
Jul 3, 2011, 1:14:45 PM7/3/11
to nltk-...@googlegroups.com
Unless you qualify for an academic license, yes. http://www.enthought.com/products/edudownload.php



Craig Hagerman
July 3, 2011 1:10 PM


Correa Denzil
June 30, 2011 5:22 AM

Dmitry :

I have made this suggestion earlier in the thread. Please use Enthought's Python Distribution(EPD).

--Regards,
Denzil





--
You received this message because you are subscribed to the Google Groups "nltk-users" group.
To post to this group, send email to nltk-...@googlegroups.com.
To unsubscribe from this group, send email to nltk-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nltk-users?hl=en.


Dmitry Gorbachev
June 29, 2011 10:21 PM

I also wanted to install nltk. Actually I did this on the prebuilt Mac python
5.3 or something. I downloaded nltk modules via nltk.download() OK.
Then I tried to run: from nltk.book import *



bspr...@me.com
June 29, 2011 2:18 PM

For what it's worth, I'm having exactly the same problem -- same two
error messages (exc. for different path) -- even though matplotlib,
numpy, and nltk are in the same directory and I've imported each of
them. I did have to do a sys.path.append() to get Python to admit the
modules exist, which is a bit odd given that they're in the site-
packages for the 2.7 version that's running, and the old 2.6 version
is *not* in the path at all. --- Bill S.

Bio
June 29, 2011 1:47 PM
Hi Richard, Thank you for your response. Unfortunately I am still
unable to get working versions of numpy or matplotlib. When I perform
an easy_install for both numpy and matplotlib the install proceeds but
several error messages occur. Then when I try to use matplotlib I get
error messages indicating the matplotlib is not present. Here is the
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.6/site-packages/nltk/text.py", line 461, in
dispersion_plot
dispersion_plot(self, words)
File "/Library/Python/2.6/site-packages/nltk/draw/dispersion.py",
line 25, in dispersion_plot
raise ValueError('The plot function requires the matplotlib
package (aka pylab).'
ValueError: The plot function requires the matplotlib package (aka

Correa Denzil

unread,
Jul 3, 2011, 2:54:49 PM7/3/11
to nltk-...@googlegroups.com
A myth which held myself back for a long time too. I would especially recommend EPD for Mac OS X due to the numerous issues with Python versions.


--Regards,
Denzil

Correa Denzil

unread,
Jul 3, 2011, 2:57:12 PM7/3/11
to nltk-...@googlegroups.com
It also comes with it's own easy_install version. It's also really helpful while installing other packages. More so, if you use Python with an IDE like Eclipse (via PyDev plugin).

--Regards,
Denzil

Mícheál John Ó Meachair

unread,
Jul 8, 2014, 10:15:27 AM7/8/14
to nltk-...@googlegroups.com, leu...@gmail.com
Hi everybody,

I know I havn't read the whole thread, but I had this same issue again now in 2014 and thought it was worth updating the thread.

Below is a quote from StackOverflow a found that solved all of my problems with Py 2.7 on Win 7 64-bit (ALL THE ISSUE RAISERS!!!)

Anyway, I got my 64-bit libraries et cetera from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/
and everything is working fine for me now.


"I got this problem too,than I fount I should install the dependencies first.(I use python 2.7 64bit)

Here's a list of the programs you can install on windows:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

And you'll need the following dependencies: Requires numpy, dateutil, pytz, pyparsing, six"


Beir bua,
mjm

Denzil Correa

unread,
Jul 9, 2014, 9:43:58 AM7/9/14
to nltk-...@googlegroups.com, leu...@gmail.com
Currently, I would recommend using Anaconda Python Distribution. It works smoothly and has a 64-bit version as well.



--Regards,
Denzil



--
You received this message because you are subscribed to the Google Groups "nltk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nltk-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mikhail Korobov

unread,
Jul 9, 2014, 10:31:21 AM7/9/14
to nltk-...@googlegroups.com, leu...@gmail.com
Hi,

With recent pip versions numpy and matplotlib should install without a need to use compiler on OS X because there are binary wheels uploaded to pypi.

It should be possible to install them in virtualenv on Windows 64 bit too:

1. make sure pip is up to date;
2. run "pip install -f https://nipy.bic.berkeley.edu/scipy_installers numpy"

Could someone please check if this works on Windows?

среда, 9 июля 2014 г., 19:43:58 UTC+6 пользователь Denzil Correa написал:
Reply all
Reply to author
Forward
0 new messages