awesome, thank you so much for the tip AK Eric!! I didn't know, that is such a gamechanger! cheers
Le samedi 18 septembre 2021 à 14:32:28 UTC-4, AK Eric a écrit : > FWIW, I've always had trouble using pip to install python packages in > Python 2.7. I'm now on 2022 / Python 3.7 now, and installing packages via > pip amazingly, 'just works'. I can install matplotlib, numpy, scipy, > pandas, tensorflow, etc, all just via pip. > > Run shell as admin and: > > "C:\Program Files\Autodesk\Maya2022\bin\mayapy.exe" -m pip install > matplotlib --target "C:\some\optional\custom\path\if\you\want\site-packages" > > Autodesk themselves have updated their docs with this info: > > https://help.autodesk.com/view/MAYAUL/2022/ENU/?guid=GUID-72A245EC-CDB4-46AB-BEE0-4BBBF9791627 > > Now, this won't help you if you're *still on Python 2.7* : Just calling > out that there 'is hope', somewhere in the future, once you move to Python > 3. > > On Monday, May 24, 2021 at 1:51:56 PM UTC-7 justin hidair wrote: > >> Re, unfortunately those env variables are not discarding vs2008 >> tried as admin, tried to restart , tried powershell as well >> it's as if nothing happened at all, quite frustrating honestly >> >> > I don't have much experience compiling on windows so maybe a windows >> user will recognize the fix. >> >> man you're blessed not to have to deal with such bullsh*t >> >> On Monday, May 24, 2021 at 9:07:15 PM UTC+2 justin hidair wrote: >> >>> thank you guys going to try all the suggestions >>> but wouldn't it make sense to have the same MSVC version as the one they >>> built their python with ? >>> >>> [image: cmd_uw6R7GsUGh.png] >>> >>> this is visual studio 2015 here not 2017, so ??? >>> but yeah let's go on with the rest of the suggestions first >>> >>> On Monday, May 24, 2021 at 8:00:17 PM UTC+2 justin...@gmail.com wrote: >>> >>>> >>>> >>>> On Tue, 25 May 2021, 5:41 am justin hidair, <justin...@gmail.com> >>>> wrote: >>>> >>>>> here's the best I managed >>>>> https://gist.github.com/yetigit/c2f55bdb8b1798b2936687567f9c6c1e >>>> >>>> >>>> >>>> Looks like maybe the wrong Visual Studio C++ compiler for Maya 2020? In >>>> addition to C++being difficult to build, combining that with Maya on >>>> Windows is even harder. >>>> I don't have much experience compiling on windows so maybe a windows >>>> user will recognize the fix. >>>> A quick look shows that Maya 2020 says it uses Visual Studio C++ 2017. >>>> >>>> >>>>> >>>>> On Monday, May 24, 2021 at 1:59:52 PM UTC+2 Marcus Ottosson wrote: >>>>> >>>>>> Could you post some of those error messages? Maybe someone here >>>>>> recognises and could help resolve those. >>>>>> >>>>>> I don’t think there’s a silver bullet, each library build has its >>>>>> quirks and challenges despite the community trying to adhere to >>>>>> standards >>>>>> there are like massive disparities on how easy it is to build something >>>>>> versus how confusing and annoying it is to build another >>>>>> >>>>>> I think we’ve got C and C++ to thank for this haha. Or rather, thank >>>>>> Python for shielding us from the horrors of compiled software out there, >>>>>> it’s hard to understate how much more accessible it makes programming >>>>>> for >>>>>> this benefit alone. I bet anyone dabbling with C++ can attest to the >>>>>> pain >>>>>> and recurrence of dependencies in everyday life. For a modern example, >>>>>> just >>>>>> look at USD! >>>>>> >>>>>> That said, it’s certainly possible. One clue might be looking at how >>>>>> the native Python packages are built for matplotlib. >>>>>> >>>>>> - >>>>>> >>>>>> https://github.com/matplotlib/matplotlib/blob/master/.github/workflows/cibuildwheel.yml >>>>>> >>>>>> >>>>>> The curveball Maya throws at you is that most build scripts out there >>>>>> assume a system-wide install of Python, and makes hardcoded assumptions >>>>>> about where to find libraries and headers. In a CI environment like >>>>>> that, >>>>>> it wouldn’t be unreasonable to mount Maya’s files over the native ones, >>>>>> to >>>>>> trick such build scripts into using the proper ones. >>>>>> >>>>>> On Mon, 24 May 2021 at 12:15, justin hidair <justin...@gmail.com> >>>>>> wrote: >>>>>> >>>>>>> re, yes forgot to mention my attempts at compiling it were made with >>>>>>> mayapy.exe, still failed with opaque error messages >>>>>>> >>>>>>> I don't think there's a silver bullet, each library build has its >>>>>>> quirks and challenges despite the community trying to adhere to >>>>>>> standards >>>>>>> there are like massive disparities on how easy it is to build >>>>>>> something versus how confusing and annoying it is to build another >>>>>>> >>>>>>> On Monday, May 24, 2021 at 9:41:44 AM UTC+2 Marcus Ottosson wrote: >>>>>>> >>>>>>>> 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.ga...@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 <justin...@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_m...@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_m...@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_m...@googlegroups.com. >>>>>>> >>>>>> To view this discussion on the web visit >>>>>>> https://groups.google.com/d/msgid/python_inside_maya/db2915d7-8692-4821-9f26-d1ad35654e14n%40googlegroups.com >>>>>>> >>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/db2915d7-8692-4821-9f26-d1ad35654e14n%40googlegroups.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_m...@googlegroups.com. >>>>> >>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/python_inside_maya/b67f54b5-d546-4a24-8517-750708674f12n%40googlegroups.com >>>>> >>>>> <https://groups.google.com/d/msgid/python_inside_maya/b67f54b5-d546-4a24-8517-750708674f12n%40googlegroups.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/55366c1e-812c-41c1-9889-973e8a9008d3n%40googlegroups.com.