This topic is so common it really needs to be highlighted somewhere. Maybe
as a new Maya splash screen? xD

[image: notcompatible]

The problem though is that many packages *are* compatible, it’s only the
compiled packages that are not. So it’s understandable that it keeps
getting confused. Can only imagine the number of hours lost trying to
shoehorn PyPI into Maya, and the subsequent number of hours struggling with
random crashes due to *suceeding* to shoehorn it in; when it seems to work
- like NumPy sometime does - but really shouldn’t.

I even tried to compile it although failing countless times at that .

The trick is compiling it with *Maya’s* Python, it’s the only way. In most
cases it really needs to be mayapy, since it itself was built with a
different compiler than the one on python.org. The same compiler as Maya
was built with, and the same compiler your library needs to be built with.
Which is why you most often also need a separate build for each major
version of Maya, see the development docs for which compiler version they
use and when they switch. Some versions of Maya use the same.

I was looking for an example of how PyQt is compiled for Maya that isn’t
too convoluted. The process would be similar here. The closest one I can
find that contains each step is this.

   - https://github.com/pyqt/python-qt5/wiki/Compiling-PyQt5-on-Ubuntu-12.04

Replacing any mention of python with mayapy and (optionally, but safest)
explicitly passing Maya’s Python headers to configure.py or setup.py etc.

Maybe someone else has a guide on compiling *anything* for Maya
specifically? It can be really hard, like NumPy, because of all the
dependencies involved. But sometimes the light shines on you and it’ll be
over before you know it.

On Mon, 24 May 2021 at 06:20, Alok Gandhi <alok.gandhi2...@gmail.com> wrote:

> I think the only this would work is to compile it against the maya version
> you are using, unless there is some existing pre-built binaries that I am
> not aware of.
>
> Another approach, though very convoluted, would be to first create a
> system level command (one that you can run outside maya from any terminal
> and accepts data, returns the result), call it from maya using either a
> Popen or os.system.
>
> On Mon, May 24, 2021, 07:52 justin hidair <justinhid...@gmail.com> wrote:
>
>> Hello here fellas,
>> sorry for the form I'm on mobile
>>
>>
>> I've been trying everything to run matplotlib from maya (2020 win x64)
>>
>> that include installing it from mayapy.exe -m pip , downloading
>> third-party packages and other older versions ;I even tried to compile it
>> although failing countless times at that .
>>
>> And the result most of the times was you could import matplotlib at first
>> without apparent issues but as soon as you tried to import
>> matplotlib.pyplot you would get errors of DLL loading failure (guess it has
>> something to do with freetype and libpng binaries which matplotlib depends
>> on)
>>
>> Now I really really want to use matplotlib from within maya. If you could
>> help me do that and also tell me how you did it Id be super grateful and
>> would buy you lunch via paypal or something
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to python_inside_maya+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAHJS-05A%3DxJCD9qSj6EciaghQXvO%3DOAuJJjMkz_CEQ3KdusuqA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAHJS-05A%3DxJCD9qSj6EciaghQXvO%3DOAuJJjMkz_CEQ3KdusuqA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAPaTLMS3%2BiH5XQb%2BdoBt8t3CBXxvjo1xkQhbzxa2uJAi_xeOQQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAPaTLMS3%2BiH5XQb%2BdoBt8t3CBXxvjo1xkQhbzxa2uJAi_xeOQQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODVWCqrJ8MjXCN6%3DJgL02pSy6UFxmvormgdrUcLzEWZUQ%40mail.gmail.com.

Reply via email to