-
-
Notifications
You must be signed in to change notification settings - Fork 455
Automatic Python installation for Python plugins #319
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
Conversation
|
I want to know which python version will be installed. Complete version contains interpreter, idle and some script(includes pip and others). |
|
Python 3.9 will be installed |
| else | ||
| { | ||
| var installation = Task.Run(async () => { await DroplexPackage.Drop(App.python3_9_1).ConfigureAwait(false); }); | ||
| installation.Wait(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emmm since we are waiting it, why do we need to wrap it within the Task.Run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@taooceros this should be synchronous, is there another way to do this without converting the calling methods async?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simply Wait the task do be done. DroplexPackage.Drop(App.python3_9_1).Wait(timeout), while timeout is the time to be waited. However I don't think would be great to let user wait downloading python at initialization, since it takes a while and will block other Flow's functionality.
I think this should be done async, disabling python plugin first if python not installed (also ask whether user has installed python similar to what has done in Everything plugin), and once it has downloaded successfully, enabling them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine because the installation has a prompt from Python, so user knows it's installing.
It does also ask the user if they want to select the location beforehand as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh ok I haven't looked at the newer part of the code.
However, I still think we should wait python installation at initialization, but let it does the job on background.
Is it possible to disable all python plugin and then later enable them after python installed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think python includes a great cdn so users in China may encounter significant of time of downloading it. However, I do agree with you that disabling and enabling plugins will bring quite a mess with at this stage.
Maybe don't load python plugin, and force restarting Flow after Python has installed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python install file is only 28mbs, can you test it out see if it takes long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python install file is only 28mbs, can you test it out see if it takes long
Will take a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for testing. How long before it's timeout?
Is it timing out on connection or during the downloading?
|
Just quick test this, when python 3.9 missing, Flow will auto install python 3.9 👍 Though my plugin is not usable right now (previously works with Flow-1.6.0), got 2 problems, related, but maybe outside scope of this PR:
|
|
Right now, Flow is using Python 3.9 directly, without virtualenv, this can be pretty annoying for python 3.9 user that use it for something else other than Flow. So, after Flow install Python 3.9, I think Flow should make a new virtualenv, and change the python path to something like this in the settings page: |
|
lets tackle this separately. This PR is to get python installed. We need to figure out how to auto install/uninstall requirement.txt cleanly |
|
@pc223 the rpc error has been fixed in #324 |
Nice! I'll try it out when I got the time 😄 |
|
It should be downloading, but I am not sure. I think is is because the downloading speed is really slow, so timeout.
…------------------ 原始邮件 ------------------
发件人: "Jeremy Wu"<[email protected]>;
发送时间: 2021年2月7日(星期天) 晚上7:40
收件人: "Flow-Launcher/Flow.Launcher"<[email protected]>;
抄送: "天煞"<[email protected]>; "Mention"<[email protected]>;
主题: Re: [Flow-Launcher/Flow.Launcher] Automatic Python installation for Python plugins (#319)
@jjw24 commented on this pull request.
In Flow.Launcher.Core/Plugin/PluginsLoader.cs:
> + if (File.Exists(pythonPath)) + { + settings.PythonDirectory = pythonDirectory; + Constant.PythonPath = pythonPath; + } + else + { + MessageBox.Show("Can't find python in given directory"); + } + } + } + } + else + { + var installation = Task.Run(async () => { await DroplexPackage.Drop(App.python3_9_1).ConfigureAwait(false); }); + installation.Wait();
Thank you for testing. How long before it's timeout?
Is it timing out on connection or during the downloading?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
This version will install the idle (GUI). The general user doesn't need that thing. And the main version is 3.8 could be better because 3.9 released recently. I recommend installing miniconda Miniconda only contains interpreter and scripts. |
|
Official python = idle + script(pip) + interpreter
Miniconda = script(pip, conda) + interpreter
If you thought miniconda didn’t have many packages another choice could be anaconda. Anaconda size is x.0GB+. But I’ m not prefer that.
… 在 2021年2月9日,14:23,taooceros ***@***.***> 写道:
Python 3.9 will be installed
This version will install the idle (GUI). The general user doesn't need that thing.
And the main version is 3.8 could be better because 3.9 released recently.
I recommend installing miniconda
Miniconda only contains interpreter and scripts.
But isn't miniconda include too much package that generally is not useful for Flow plugin?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
Anyway package is the problem of next step not now. |
|
This build from 20f895c should resolve download timeout issues. Thanks @taooceros |
|
This is for 1.8.0 release, do not merge if approved. |
|
Are there any thing we still need to do for 1.7.1? |
|
Hmm not at this stage. Although we don't have anything pending to go out urgently in 1.8.0 as well right, figure we might catch more bugs for 1.7.1 |
I think we should at least release the fix in #322 since it blocks python plugins from working. |
Yeah makes sense, let's release 1.7.1, let's still hold off on 1.8.0 PRs for a bit to see if anymore bugs come up. What do you think? |
|
Yeah agree with you. Actually, I think we can release a pre-release before any large change, and see whether some bugs can be catched by that so that we can fix it before official release. |
| } | ||
| else | ||
| { | ||
| Log.Error("PluginsLoader", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if user choose to install python on other path instead of the default path? I think we should allow selection if that it not found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is to auto set path after auto install. Users can choose the path before hand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I mean what if user don't choose to install python on the default path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy Chinese New Year @taooceros :)
The installation will just install to the default location, it's a passive install, no prompt for install location
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy New Year!!! 😃😃
Oh I see. That will be great!
Well, I don't know if people download that though, right now pre-releases needed to be manually downloaded |
|
I think wox allows user to choose downloading prerelease. Isn't flow containing one? |
Nah we haven't built it in. I would prefer something like squirrel's diff release where update is on new changes rather than the whole app. Problem with pre-releases is that it will just sit there forever and too much reliance on it to catch bugs is not effective, nobody wants to use a buggy version. |
|
emm you are right, but we still need more testing before large release, because sometimes it is hard for us to find bugs during our personal usage. Maybe we can ask someone who are willing to try the new feature to take a try on the prerelease, and after it becomes stable, then we release the official release. |
|
@taooceros This is good to go out for 1.8.0? |
Ah yes! |
Good pick up, I will need to look into miniconda along with the other suggestions and will change it later if needed. |
|
We can discuss this further in the discord plugin-dev channel. Once decided it's just a matter of changing the droplex package. |


If any Python plugins exist upon start up and the PythonDirectory in Settings is empty: