I'm trying to make a little program that sets up a portable python 3 with specific packages, with no admin rights required.
(The point of this is to execute some specific scripts with more ease and in a way that could be distributed to other people easily)
So I have downloaded the latest Windows embeddable package of python and installed pip on it, along with the modules I needed.
But when executing the python script that I made this entire mess for, it threw me a ModuleNotFoundError
. The module in question is a local file, in the same directory as the main script.
Normally, when importing a module, python looks in the installed packages folder, but also in the directory in which the script that's being executed is located. This doesn't seem to be the case with an embedded python by default, though.
I had to change some settings in a ._pth
file for python to even look into the installed packages folder, thanks to another post. But I couldn't find what to do to make it also look into the directory of the script it's executing, like regular python does.
I hope someone has an idea to fix that, thanks in advance :)