matplotlib._path failed on windows build for Python 2.6

Hello,

I’ve tried to build matplotlib 0.98.5.2 for Python 2.6 under Windows (Win2k) using MinGW and win32_static. After a few fixes, the compilation and install appear to be ok, but I’ve got stuck at importing matplotlib._path (see transcript below).

Any suggestions on what is going wrong and how to fix it?

C:\My Programs\matplotlib-0.98.5.2>ipython -pylab
C:\Python26\lib\site-packages\IPython\Magic.py:38: DeprecationWarning: the sets
module is deprecated
from sets import Set
Traceback (most recent call last):

File “C:\Python26\scripts\ipython.py”, line 28, in
IPython.Shell.start().mainloop()
File “C:\Python26\Lib\site-packages\IPython\Shell.py”, line 1233, in start
return shell(user_ns = user_ns)

File “C:\Python26\Lib\site-packages\IPython\Shell.py”, line 1108, in init
shell_class=MatplotlibMTShell)
File “C:\Python26\Lib\site-packages\IPython\Shell.py”, line 793, in init

on_kill=[mainquit])

File “C:\Python26\Lib\site-packages\IPython\ipmaker.py”, line 103, in make_IPy
thon
embedded=embedded,**kw)
File “C:\Python26\Lib\site-packages\IPython\Shell.py”, line 639, in init

user_ns,user_global_ns,b2 = self._matplotlib_config(name,user_ns,user_global

_ns)
File “C:\Python26\Lib\site-packages\IPython\Shell.py”, line 559, in _matplotli
b_config
import matplotlib.pylab as pylab

File “C:\Python26\lib\site-packages\matplotlib\pylab.py”, line 206, in <module

from matplotlib import mpl  # pulls in most modules

File “C:\Python26\lib\site-packages\matplotlib\mpl.py”, line 1, in

from matplotlib import artist

File “C:\Python26\lib\site-packages\matplotlib\artist.py”, line 5, in

from transforms import Bbox, IdentityTransform, TransformedBbox, Transformed
Path
File “C:\Python26\lib\site-packages\matplotlib\transforms.py”, line 34, in <mo

from matplotlib._path import affine_transform

ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

C:\My Programs\matplotlib-0.98.5.2>

Lorenzo Di Gregorio wrote:

Hello,

I've tried to build matplotlib 0.98.5.2 for Python 2.6 under Windows
(Win2k) using MinGW and win32_static. After a few fixes, the
compilation and install appear to be ok, but I've got stuck at
importing matplotlib._path (see transcript below).
Any suggestions on what is going wrong and how to fix it?

  File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 5,
in <module>

    from transforms import Bbox, IdentityTransform, TransformedBbox,
Transformed
Path
  File "C:\Python26\lib\site-packages\matplotlib\transforms.py", line
34, in <mo
>
    from matplotlib._path import affine_transform
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht
gefunden.

Did _path.cpp get compiled to a .pyd OK? (Do you have
C:\PYTHON26\Lib\site-packages\matplotlib\_path.pyd installed? -- I guess
that's where it would be... Not running Python on Windows, though, I
could be off a bit.)

And, as a hint to anyone else attempting to debug this: the above
traceback means "The given procedure was not found". (And Lorenzo Di
Gregorio doesn't sound like a very German name to me, so why your
computer is speaking German I don't know... :slight_smile:

I do find something nice about running Python 2.6 under Win2k, though...

Andrew

Lorenzo Di Gregorio wrote:

Hello,

I’ve tried to build matplotlib 0.98.5.2 for Python 2.6 under Windows

(Win2k) using MinGW and win32_static. After a few fixes, the

compilation and install appear to be ok, but I’ve got stuck at

importing matplotlib._path (see transcript below).

Any suggestions on what is going wrong and how to fix it?

File “C:\Python26\lib\site-packages\matplotlib\artist.py”, line 5,

in

from transforms import Bbox, IdentityTransform, TransformedBbox,

Transformed

Path

File “C:\Python26\lib\site-packages\matplotlib\transforms.py”, line

34, in <mo

from matplotlib._path import affine_transform

ImportError: DLL load failed: Die angegebene Prozedur wurde nicht

gefunden.

Did _path.cpp get compiled to a .pyd OK? (Do you have

C:\PYTHON26\Lib\site-packages\matplotlib_path.pyd installed? – I guess

that’s where it would be… Not running Python on Windows, though, I

could be off a bit.)

Yes, that’s compiled and installed at the location you mentioned.
In fact I have no idea what is wrong with that.
How does a .pyd reference a DLL and what is it supposed to load?

And, as a hint to anyone else attempting to debug this: the above

traceback means “The given procedure was not found”. (And Lorenzo Di

Gregorio doesn’t sound like a very German name to me, so why your

computer is speaking German I don’t know… :slight_smile:

Right,
I don’t know either why I haven’t switched it already :wink: But
mitigating circumstances for lazyness are that German is my second
language, my wife is German, I live and work in Germany etc.

I do find something nice about running Python 2.6 under Win2k, though…

… under Linux it was too easy :stuck_out_tongue_winking_eye: (my company runs Win2k!)

···

On Thu, Apr 9, 2009 at 7:06 AM, Andrew Straw <strawman@…106…> wrote:

Can you send us the output of this Python session to help us debug? I'm curious what symbols *are* in there.

>>> import matplotlib._path
>>> dir(matplotlib._path)
['__doc__', '__file__', '__name__', 'affine_transform', 'clip_path_to_rect', 'convert_path_to_polygons', 'count_bboxes_overlapping_bbox', 'get_path_collection_extents', 'get_path_extents', 'path_in_path', 'path_intersects_path', 'point_in_path', 'point_in_path_collection', 'point_on_path', 'update_path_extents']
>>>

Cheers,
Mike

Lorenzo Di Gregorio wrote:

···

On Thu, Apr 9, 2009 at 7:06 AM, Andrew Straw <strawman@...106... > <mailto:strawman@…106…>> wrote:

    Lorenzo Di Gregorio wrote:
    > Hello,
    >
    > I've tried to build matplotlib 0.98.5.2 for Python 2.6 under Windows
    > (Win2k) using MinGW and win32_static. After a few fixes, the
    > compilation and install appear to be ok, but I've got stuck at
    > importing matplotlib._path (see transcript below).
    > Any suggestions on what is going wrong and how to fix it?
    >
    > File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 5,
    > in <module>
    >
    > from transforms import Bbox, IdentityTransform, TransformedBbox,
    > Transformed
    > Path
    > File "C:\Python26\lib\site-packages\matplotlib\transforms.py",
    line
    > 34, in <mo
    > >
    > from matplotlib._path import affine_transform
    > ImportError: DLL load failed: Die angegebene Prozedur wurde nicht
    > gefunden.
    >
    Did _path.cpp get compiled to a .pyd OK? (Do you have
    C:\PYTHON26\Lib\site-packages\matplotlib\_path.pyd installed? -- I
    guess
    that's where it would be... Not running Python on Windows, though, I
    could be off a bit.)

Yes, that's compiled and installed at the location you mentioned.
In fact I have no idea what is wrong with that.
How does a .pyd reference a DLL and what is it supposed to load?

    And, as a hint to anyone else attempting to debug this: the above
    traceback means "The given procedure was not found". (And Lorenzo Di
    Gregorio doesn't sound like a very German name to me, so why your
    computer is speaking German I don't know... :slight_smile:

Right, I don't know either why I haven't switched it already :wink: But mitigating circumstances for lazyness are that German is my second language, my wife is German, I live and work in Germany etc.

    I do find something nice about running Python 2.6 under Win2k,
    though...

... under Linux it was too easy :stuck_out_tongue_winking_eye: (my company runs Win2k!)
------------------------------------------------------------------------

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Well, that’s exactly the problem: I just can’t load some DLLs!

import matplotlib._path

Traceback (most recent call last):
File “<pyshell#0>”, line 1, in
import matplotlib._path
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

import matplotlib._delaunay
import matplotlib._image

Traceback (most recent call last):
File “<pyshell#2>”, line 1, in
import matplotlib._image
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

I have run python -vv, it tries also …_path but does not load it, so I think it might be a linking problem.

I’ve noticed that _delaunay.cpp has a “PyMODINIT_FUNC init_delaunay(void)” while _path.cpp has just a “void init_path(void)”.

Best Regards,

Lorenzo

···

On 4/9/09, Michael Droettboom <mdroe@…86…> wrote:

Can you send us the output of this Python session to help us debug? I’m curious what symbols are in there.

import matplotlib._path
dir(matplotlib._path)
[‘doc’, ‘file’, ‘name’, ‘affine_transform’, ‘clip_path_to_rect’, ‘convert_path_to_polygons’, ‘count_bboxes_overlapping_bbox’, ‘get_path_collection_extents’, ‘get_path_extents’, ‘path_in_path’, ‘path_intersects_path’, ‘point_in_path’, ‘point_in_path_collection’, ‘point_on_path’, ‘update_path_extents’]

Cheers,
Mike

Lorenzo Di Gregorio wrote:

On Thu, Apr 9, 2009 at 7:06 AM, Andrew Straw <strawman@…83…106… mailto:strawman@...2546......> wrote:

Lorenzo Di Gregorio wrote:

Hello,

I’ve tried to build matplotlib 0.98.5.2 for Python 2.6 under Windows
(Win2k) using MinGW and win32_static. After a few fixes, the

compilation and install appear to be ok, but I’ve got stuck at
importing matplotlib._path (see transcript below).
Any suggestions on what is going wrong and how to fix it?

File “C:\Python26\lib\site-packages\matplotlib\artist.py”, line 5,

in

from transforms import Bbox, IdentityTransform, TransformedBbox,

Transformed
Path
File “C:\Python26\lib\site-packages\matplotlib\transforms.py”,

line

34, in <mo

from matplotlib._path import affine_transform

ImportError: DLL load failed: Die angegebene Prozedur wurde nicht
gefunden.

Did _path.cpp get compiled to a .pyd OK? (Do you have
C:\PYTHON26\Lib\site-packages\matplotlib_path.pyd installed? – I
guess
that’s where it would be… Not running Python on Windows, though, I

could be off a bit.)

Yes, that’s compiled and installed at the location you mentioned.
In fact I have no idea what is wrong with that.
How does a .pyd reference a DLL and what is it supposed to load?

And, as a hint to anyone else attempting to debug this: the above
traceback means “The given procedure was not found”. (And Lorenzo Di
Gregorio doesn’t sound like a very German name to me, so why your

computer is speaking German I don’t know… :slight_smile:

Right, I don’t know either why I haven’t switched it already :wink: But mitigating circumstances for lazyness are that German is my second language, my wife is German, I live and work in Germany etc.

I do find something nice about running Python 2.6 under Win2k,
though…

… under Linux it was too easy :stuck_out_tongue_winking_eye: (my company runs Win2k!)



This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!

http://p.sf.net/sfu/www-ibm-com


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Lorenzo Di Gregorio wrote:

Well, that's exactly the problem: I just can't load some DLLs!
>>> import matplotlib._path

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import matplotlib._path
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.
>>> import matplotlib._delaunay
>>> import matplotlib._image

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import matplotlib._image
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

I have run python -vv, it tries also ..._path but does not load it, so I think it might be a linking problem.
I've noticed that _delaunay.cpp has a "PyMODINIT_FUNC init_delaunay(void)" while _path.cpp has just a "void init_path(void)".

If you make that change, does it work?

Mike

···

Best Regards,
Lorenzo
On 4/9/09, *Michael Droettboom* <mdroe@...86... > <mailto:mdroe@…86…>> wrote:

    Can you send us the output of this Python session to help us
    debug? I'm curious what symbols *are* in there.

    >>> import matplotlib._path
    >>> dir(matplotlib._path)
    ['__doc__', '__file__', '__name__', 'affine_transform',
    'clip_path_to_rect', 'convert_path_to_polygons',
    'count_bboxes_overlapping_bbox', 'get_path_collection_extents',
    'get_path_extents', 'path_in_path', 'path_intersects_path',
    'point_in_path', 'point_in_path_collection', 'point_on_path',
    'update_path_extents']
    >>>

    Cheers,
    Mike

    Lorenzo Di Gregorio wrote:

        On Thu, Apr 9, 2009 at 7:06 AM, Andrew Straw > <strawman@...106... <mailto:strawman@…106…> > <mailto:strawman@…106…>> wrote:

           Lorenzo Di Gregorio wrote:
           > Hello,
           >
           > I've tried to build matplotlib 0.98.5.2 for Python 2.6
        under Windows
           > (Win2k) using MinGW and win32_static. After a few fixes, the
           > compilation and install appear to be ok, but I've got
        stuck at
           > importing matplotlib._path (see transcript below).
           > Any suggestions on what is going wrong and how to fix it?
           >
           > File
        "C:\Python26\lib\site-packages\matplotlib\artist.py", line 5,
           > in <module>
           >
           > from transforms import Bbox, IdentityTransform,
        TransformedBbox,
           > Transformed
           > Path
           > File
        "C:\Python26\lib\site-packages\matplotlib\transforms.py",
           line
           > 34, in <mo
           > >
           > from matplotlib._path import affine_transform
           > ImportError: DLL load failed: Die angegebene Prozedur
        wurde nicht
           > gefunden.
           >
           Did _path.cpp get compiled to a .pyd OK? (Do you have
           C:\PYTHON26\Lib\site-packages\matplotlib\_path.pyd
        installed? -- I
           guess
           that's where it would be... Not running Python on Windows,
        though, I
           could be off a bit.)

        Yes, that's compiled and installed at the location you mentioned.
        In fact I have no idea what is wrong with that.
        How does a .pyd reference a DLL and what is it supposed to load?
                    And, as a hint to anyone else attempting to debug this: the
        above
           traceback means "The given procedure was not found". (And
        Lorenzo Di
           Gregorio doesn't sound like a very German name to me, so
        why your
           computer is speaking German I don't know... :slight_smile:

        Right, I don't know either why I haven't switched it already
        ;-) But mitigating circumstances for lazyness are that German
        is my second language, my wife is German, I live and work in
        Germany etc.

           I do find something nice about running Python 2.6 under Win2k,
           though...

        ... under Linux it was too easy :stuck_out_tongue_winking_eye: (my company runs Win2k!)
        ------------------------------------------------------------------------

        ------------------------------------------------------------------------------
        This SF.net email is sponsored by:
        High Quality Requirements in a Collaborative Environment.
        Download a free trial of Rational Requirements Composer Now!
        http://p.sf.net/sfu/www-ibm-com
        ------------------------------------------------------------------------

        _______________________________________________
        Matplotlib-users mailing list
        Matplotlib-users@lists.sourceforge.net
        <mailto:Matplotlib-users@lists.sourceforge.net>
        matplotlib-users List Signup and Options
         
    -- Michael Droettboom
    Science Software Branch
    Operations and Engineering Division
    Space Telescope Science Institute
    Operated by AURA for NASA

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Well, that’s exactly the problem: I just can’t load some DLLs!

import matplotlib._path

Traceback (most recent call last):
File “<pyshell#0>”, line 1, in
import matplotlib._path
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

import matplotlib._delaunay

import matplotlib._image

Traceback (most recent call last):
File “<pyshell#2>”, line 1, in
import matplotlib._image
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

I have run python -vv, it tries also …_path but does not load it, so I think it might be a linking problem.
I’ve noticed that _delaunay.cpp has a “PyMODINIT_FUNC init_delaunay(void)” while _path.cpp has just a “void init_path(void)”.
Lorenzo Di Gregorio wrote:
If you make that change, does it work?

No, I tried.

I have also tried to start python -vv.

For _delaunay I get a correct import.

trying C:\Python26\lib\site-packages\matplotlib_delaunay.pyd

import matplotlib._delaunay # dynamically loaded from C:\Python26\lib\site-packages\matplotlib_delaunay.pyd

For _path and _image I get

import matplotlib._path

trying C:\Python26\lib\site-packages\matplotlib_path.pyd

Traceback (most recent call last):
File “”, line 1, in
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

import matplotlib._image

trying C:\Python26\lib\site-packages\matplotlib_image.pyd

Traceback (most recent call last):
File “”, line 1, in
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

So Python checks the right place but then concludes that the DLL is not there. I guess something goes wrong with the linking, but in fact I do not know how to write a DLL for Python and I’m stuck now.

I have checked that the compilation was ok and the rest of the installation (GTK+ etc) is ok. I can import matplotlib itself. In the packages I had only one package to patch: I think “gpobjects” had a reference to “@FFI_LIB@”. This was getting through pkg-config and stopping the compilation, so I have removed it.

… HELP! :wink:

Regards,

Lorenzo

···

On 4/10/09, Michael Droettboom <mdroe@…86…> wrote:

Ouch, it looks like MinGW and Python do not fit 100% to each other.

Please check out this bug report:

http://bugs.python.org/issue3308

"Basically MinGW erroneously ships a .lib saying localtime is in
MSVCR90.DLL when it isn’t. That means there is no link failure but the
pyd will fail to load without information as to why. Fixing the .lib

means that localtime is picked up from MSVCRT.DLL (ie no version in
name) and everything appears to work well."

···

On 4/10/09, Lorenzo Di Gregorio <lorenzo.digregorio@…287…> wrote:

On 4/10/09, Michael Droettboom <mdroe@…86…> wrote:

Well, that’s exactly the problem: I just can’t load some DLLs!

import matplotlib._path

Traceback (most recent call last):
File “<pyshell#0>”, line 1, in
import matplotlib._path
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

import matplotlib._delaunay

import matplotlib._image

Traceback (most recent call last):
File “<pyshell#2>”, line 1, in
import matplotlib._image
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

I have run python -vv, it tries also …_path but does not load it, so I think it might be a linking problem.
I’ve noticed that _delaunay.cpp has a “PyMODINIT_FUNC init_delaunay(void)” while _path.cpp has just a “void init_path(void)”.
Lorenzo Di Gregorio wrote:
If you make that change, does it work?

No, I tried.

I have also tried to start python -vv.

For _delaunay I get a correct import.

trying C:\Python26\lib\site-packages\matplotlib_delaunay.pyd

import matplotlib._delaunay # dynamically loaded from C:\Python26\lib\site-packages\matplotlib_delaunay.pyd

For _path and _image I get

import matplotlib._path

trying C:\Python26\lib\site-packages\matplotlib_path.pyd

Traceback (most recent call last):
File “”, line 1, in

ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

import matplotlib._image

trying C:\Python26\lib\site-packages\matplotlib_image.pyd

Traceback (most recent call last):

File “”, line 1, in
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

So Python checks the right place but then concludes that the DLL is not there. I guess something goes wrong with the linking, but in fact I do not know how to write a DLL for Python and I’m stuck now.

I have checked that the compilation was ok and the rest of the installation (GTK+ etc) is ok. I can import matplotlib itself. In the packages I had only one package to patch: I think “gpobjects” had a reference to “@FFI_LIB@”. This was getting through pkg-config and stopping the compilation, so I have removed it.

… HELP! :wink:

Regards,

Lorenzo