I am developing a plugin for a multi-platform Python program (Deluge). My plugin needs to import some modules which aren't available by default (in my case, the requests
module).
On Linux, everything works flawlessly assuming the required modules are installed beforehand (e.g. via pip
).
On Windows, the program makes use of python27.dll
which comes as part of the installer, so importing modules - even those available on the local Python installation (verified via interpreter) - yields an import error.
I've seen the answers to this question, but I'd like to know if there is a proper way of adding module search paths for Python on Windows specifically. Is it safe to assume C:\Python27\Lib\site-packages
will point me to the local Python installation's modules?
EDIT: Is there a different method I could incorporate for using "external" modules? Could I perhaps package other modules into my final .egg
file? Not just plain Python, but more sophisticated modules like requests
which need to be properly built and may even rely on other modules.