-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python doesn't install into a named directory #30
Comments
Which environment component and which property should I set? |
PyEmbeddedResEnvironment391.EnvironmentPath If it's blank this (stupidly simple example) works otherwise it fails Added some OnCreate code to the form - if the property is blank it's actually '$(ENVIRONMENT_PATH)\$(PYTHON_VER)' ??? I actually want to set it to something like System.IOUtils.TPath.GetHomePath + '\SomeDir' |
Let me try it out. |
The reason you'd want to set EnvironmentPath to something else is so that you can share a PythonEmbedded installation between multiple apps - something I can see being frequently desirable to save on disk space. If you're using Torch GPU (like me) then each app would have about 2.5 GB of Python if not more - very wasteful |
Think about venv: we can create different environment or share a single one. This is exactly what we want for PythonEnvironments, to work like venv. |
Yep, exactly - that's why I'm so keen to get this working on everything. A really interesting possibility is having a Delphi front end to a Linux WSL running on the same machine :) There are quite a few ML/AI libs that definitely prefer Linux (I'm sure a few demand it). NVidia's latest drivers can even virtualize your GPU into WSL - not played with this much though... |
This is the problem...
TPyEnvironmentPath.ResolvePath merely checks for the existance of a path - it doesn't check whether the passed path has anything in it. More importantly if you pass it an empty directory it'll decide you've got Python in it :) If you pass it a non-existant path then it'll create it and install Python in it. Proper thing to do would be to at least install it in an empty dir - check if the passed path is empty or not...
What's that replace doing? Ahh - replacing "$(PYTHON_VER)" with 3.9 - errm - string don't contain "$(PYTHON_VER)" in the first place - could check for that too... Might be nice to actually check if the path you're checking has a valid Python - does python lib exist yet? Actually you've got a cancel thing now - could have valid lib but cancelled half way through. Maybe drop some JSON in the directory - e.g. PythonEmbedded.json with some installation stuff? Lastly - this ain't backwards compatible with the previous version - if you already have a Python then the new version don't work as it's got completely different files in it so nothing is where is should be as far as the new one is concerned |
It always checks for an existing Python installation in the desired folder. |
Put a PythonEngine and PythonEnvironment39 on a form with a memo + button
Set PythonEnvironment to e.g. c:\temp\python (making sure you create it first)
Output...
Extra output is from event handlers on install, activate and ready and the target directory is still empty after the run
If I already have a Python in the directory then it's ignored - SharedLibrary and Executable are both empty causing InternalActivate to fail
The text was updated successfully, but these errors were encountered: