Matplotlib - python does not find pylab

Pau vim.unix at googlemail.com
Tue Mar 3 18:43:49 CET 2009


Hello,

I said Ihad tried with different versions of python

$ python2.5
Python 2.5.4 (r254:67916, Feb 26 2009, 18:20:08)
[GCC 3.3.5 (propolice)] on openbsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylab
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.5/site-packages/pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "/usr/local/lib/python2.5/site-packages/matplotlib/__init__.py",
line 129, in <module>
    from rcsetup import defaultParams, validate_backend, validate_toolbar
  File "/usr/local/lib/python2.5/site-packages/matplotlib/rcsetup.py",
line 19, in <module>
    from matplotlib.colors import is_color_like
  File "/usr/local/lib/python2.5/site-packages/matplotlib/colors.py",
line 54, in <module>
    import matplotlib.cbook as cbook
  File "/usr/local/lib/python2.5/site-packages/matplotlib/cbook.py",
line 17, in <module>
    preferredencoding = locale.getpreferredencoding()
  File "/usr/local/lib/python2.5/locale.py", line 514, in getpreferredencoding
    setlocale(LC_CTYPE, "")
  File "/usr/local/lib/python2.5/locale.py", line 478, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

This is the output when using ksh with the default config file

And also:

>>> import sys
>>> print sys.path
['', '/usr/local/lib/python25.zip', '/usr/local/lib/python2.5',
'/usr/local/lib/python2.5/plat-openbsd4',
'/usr/local/lib/python2.5/lib-tk',
'/usr/local/lib/python2.5/lib-dynload',
'/usr/local/lib/python2.5/site-packages',
'/usr/local/lib/python2.5/site-packages/Numeric',
'/usr/local/lib/python2.5/site-packages/gst-0.10',
'/usr/local/lib/python2.5/site-packages/gtk-2.0']

Do you see something? I don't...

thanks for the help

Pau

2009/3/3 Nick Guenther <kousue at gmail.com>:
> Wait, what's this about python2.4 in those paths? You said you're
> running python 2.5? What happens if you do
> $ python25
>>>> import pylab
> ?
>
> On Tue, Mar 3, 2009 at 12:31 PM, Pau <vim.unix at googlemail.com> wrote:
>> Hello,
>>
>> thanks, I thought the same and, as a matter of fact:
>>
>> hux(p8)| python
>> Python 2.4.6 (#1, Feb  9 2009, 15:01:16)
>> [GCC 3.3.5 (propolice)] on openbsd4
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import sys
>>>>> print sys.path
>> ['', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4',
>> '/usr/local/lib/python2.4/plat-openbsd4',
>> '/usr/local/lib/python2.4/lib-tk',
>> '/usr/local/lib/python2.4/lib-dynload',
>> '/usr/local/lib/python2.4/site-packages']
>>>>>
>>
>> But where is pylab? pbrowser doesn't find it and
>>
>> # cd /usr/ports/
>> # find . -name "*pylab*"
>>
>> yields nothing...
>>
>> Is this related to running -current? I would prefer to stick to a
>> stable, but this laptop is too modern...
>>
>> 2009/3/3 Nick Guenther <kousue at gmail.com>:
>>> On Tue, Mar 3, 2009 at 12:18 PM, Pau <vim.unix at googlemail.com> wrote:
>>>> Hello,
>>>>
>>>> I have many python scripts to plot graphs.
>>>>
>>>> I have now done a clean OpenBSD install (-current) on a thinkpad x200s.
>>>>
>>>> hux(p8)| uname -a
>>>> OpenBSD hux 4.5 GENERIC#1748 i386
>>>>
>>>> I have installed py-matplotlib and python.
>>>>
>>>> My scripts start like this:
>>>>
>>>> -------------------------------------
>>>> #!/usr/bin/env python
>>>> """
>>>> some comment
>>>> """
>>>>
>>>> from pylab import *
>>>>
>>>> # Create arrays
>>>> X     = load ( './BinaryData_0.dat')
>>>> etc etc
>>>> -------------------------------------
>>>>
>>>> I have done thousands of plots with this scheme.
>>>>
>>>> But now, when I try to execute the script, I get
>>>>
>>>> Traceback (most recent call last):
>>>>  File "./KozaiEccSemi.py", line 11, in ?
>>>>    from pylab import *
>>>> ImportError: No module named pylab
>>>>
>>>> This is Python 2.5.4, on zsh but I have tried to both change the
>>>> python version and to use a different shell, with default config file
>>>> (my zshrc is complicated)
>>>>
>>>> The error output is always the same.
>>>>
>>>> Any help will be appreciated.
>>>>
>>>
>>> Run this python script:
>>>
>>> import sys
>>> print sys.path
>>>
>>> and then look in the dirs it spits out for anything called "pylab".
>>> It's likely that pylab wasn't installed with py-matplotlib. Did you
>>> read something that suggested it would be?
>>>
>>> -Nick
>>>
>>
>>
>>
>> --
>> Let there be peace on earth. And let it begin with misc
>>
>



-- 
Let there be peace on earth. And let it begin with misc


More information about the Openbsd-newbies mailing list