Requests module inconsistent

22 views
Skip to first unread message

Jakob Kousholt

unread,
Sep 9, 2019, 11:26:44 PM9/9/19
to python_inside_maya
Hey Guys,

I am looking to do so some server requests from inside Maya, but it seems to be very inconsistent if the requests module is installed in the python version that ships with Maya. For example on my mac it is included in 2018, but not in 2019, and on my PC no version of Maya has the request module. What makes the difference? 

Thanks,
Jake

Justin Israel

unread,
Sep 10, 2019, 12:24:27 AM9/10/19
to python_in...@googlegroups.com
I don't think you should depend on Maya's distribution to provide you with 3rd party python libraries outside of what they specifically document, such as providing PyMel. Best to use your own requests module provided from your external PYTHONPATH. Just my 2cents :-)

Justin


--
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/CAEKd6baaES4GZuhYnSawiN8BmvAH9boJ7bHb3dPGjYgoa8UfwA%40mail.gmail.com.

Alok Gandhi

unread,
Sep 10, 2019, 4:33:51 AM9/10/19
to python_in...@googlegroups.com
I agree with Justin. In our pipeline, we use a host of python package as thirdparty pieces. We have developed our own package manager and make the dependencies available from inside any dcc app environment. Using modules that ships with any dcc can become a scalability issue pretty soon as they might not be as agnostic as we would like it to be.

Better use requests that ships with vanilla python.


Jakob Kousholt

unread,
Sep 10, 2019, 11:09:40 AM9/10/19
to python_inside_maya
Thanks for the insight guys.

The reason I am asking is because I am looking to share a script which relies on the requests module, would I then just encourage people who would want to use the script to install requests as well or should I make a little bundle? I just wanna make as easy as possible for the user to get going, even if they aren't technical.
 

Marcus Ottosson

unread,
Sep 10, 2019, 3:09:02 PM9/10/19
to python_in...@googlegroups.com

You could bundle it, I think there’s a compiled/binary component with certificates involved but shouldn’t be an issue even on other platforms. However, for the easiest time distributing your software, I would consider not using requests. It would let you avoid bundling and (significantly) reduce the size of what you’re sharing. requests is great, but for this particular use case - i.e. copy/paste non-technical distribution to artists - it can be somewhat of a problem. urllib2 isn’t that bad, especially if all you need is “download this file”.


Jakob Kousholt

unread,
Sep 10, 2019, 3:20:54 PM9/10/19
to python_inside_maya
Thanks Marcus! This sounds like the best solution for my situation. I appreciate it!


Reply all
Reply to author
Forward
0 new messages