Closed Evangelink closed 3 years ago
Actually, Python.Included uses pip to install wheels. Could you clone the code and investigate by single stepping through the install procedure? I'll be happy to accept a PR if you find out what our install routines are missing.
Sure thing! I am pretty full for the rest of the day but I will have a look tomorrow and get back to you.
I am about to start the debugging but before that I just wanted to dump the results of some tests in case I am missing something obvious.
Code:
Installer.SetupPython().Wait();
Installer.InstallWheel(typeof(Foo).Assembly, "mywheel-0.1.0-py3-none-any.whl").Wait();
var isInstalled = Installer.IsModuleInstalled("mywheel");
Result:
isInstalled
is false
Dependencies of the module are not downloaded nor installed
Module content is unzipped in %LOCALAPPDATA%/python-3.7.3-embed-amd64/Lib
directly and not under site-packages
.
Same as Test 1
but I have added Installer.TryInstallPip();
before the InstallWheel
call just in case it was changing anything. Result is the same as for Test 1
.
Code:
Installer.SetupPython().Wait();
Installer.TryInstallPip();
Installer.PipInstallWheel(typeof(Foo).Assembly, "mywheel-0.1.0-py3-none-any.whl");
var isInstalled = Installer.IsModuleInstalled("mywheel");
Same result as for the previous tests.
Repeat the 3 previous tests not with my own wheel (in case it wasn't built correctly) but with easyocr-1.2.5-py3-none-any.whl
. Results are the same as previously described.
Code:
Installer.SetupPython().Wait();
Installer.TryInstallPip();
Installer.PipInstallModule("<SOME_PATH>/mywheel-0.1.0-py3-none-any.whl").Wait();
var isInstalled = Installer.IsModuleInstalled("mywheel");
Result:
isInstalled
is true
Dependencies of the module are installed
Module content is unzipped in %LOCALAPPDATA%/python-3.7.3-embed-amd64/Lib/site-packages
.
so it was all because of the missing path?
Sorry I have to admit I totally skipped the debugging part. I will make sure to add it on my weekly todo and post results.
Conclusions of the tests were that the embedded wheels do not download dependencies while the installation through a path works. At the end the problem wasn't so critical for us because we want with the install from a path and we package (on the CI) the resulting python folder into our installer so we don't need any kind of embedding or download of dependencies at runtime.
No need. If your problem is solved I'll just close this.
I have create a wheel for some python modules and have defined some dependency (e.g.
easyocr
) and when doing the call toInstaller.InstallWheel
on a fresh system, I have noticed that the dependencies do not get installed but when doing the installation manually throughpip
the dependencies are correctly retrieved.Is it the expected behavior? Or shall it be doing all the dependencies automatically?