Description
Right now, the Python standard library is not included in the build. The reason for this is because the IronPython library only exposes a method for loading python libraries from the disk (as far as I know). We can accomplish this by putting the Python library in the StreamingAssets
folder, but this is a security problem since the library can be trivially edited by any user to do whatever they might want. This is the main reason for why the included python library in unity-python doesn't work in builds right out of the box.
Several issues are affected by this problem:
- The additional steps are not very clear and make the library difficult to use since it doesn't work "out of the box" python library files at runtime #10
- It's not clear how to add additional libraries to the project No module named speech_recognition #4, Can I add more python library myself #8
- Adding additional libraries might require the addition of more .NET DLLs to the project in order for the build to work The type initializer for 'CodecsInfo' threw an exception on Build #11
I did find an approach that looks appealing recently... It might be possible to compile the Python libraries into DLLs.
If this works the way I think it does, then I can make an interface for installing Python libraries which fetches the package from pip
, compiles it into a DLL, and then adds it to your project. This would fix all of the aforementioned issues.
However, it would be best to keep in mind that Python 2 is being deprecated on January 1st, 2020 with pip
to follow suit shortly after. I have never tested the library as it stands today with Python 3 (and I don't have any reason to believe it will work). So, perhaps this work will have to wait until the library is ported to work with Python 3.