Requests: HTTP for Humans

Would it be possible to add:

http://docs.python-requests.org/en/latest/

to the Slicer distribution. It has an Apache 2.0 license and is a lot easier to use than urllib or urllib2

I agree that it would be useful. This package is Python-only, but it depends on a couple of other packages.

@jcfr What is the recommended process now for adding more Python packages to the Slicer distribution?

Note that you can install requests using pip as shown in this post: Slicer-Python Packages Use and Install. The only limitation is that on Windows you need to start Slicer as an admin, which may not be very user friendly.

1 Like

We may have a way around that. I will follow up with more details later.

1 Like

Would that work around allow an extension to load dynamically the python requests package like the above example?

Until @jcfr fixes the installation issue, you can add these packages to your extension. Simply copy the unzipped package into your module directory. See for example the ptvsd module in https://github.com/SlicerRt/SlicerDebuggingTools/tree/master/PyDevRemoteDebug