-
Notifications
You must be signed in to change notification settings - Fork 436
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
pip doesn't work on first run. #1358
Comments
OK... it looks like it's because the |
OK... that was a red herring. Still trying to figure out what's going on. |
Parking for the moment. TL;DR I don't think the slots are created in the right way here: https://github.com/mu-editor/mu/blob/master/mu/interface/dialogs.py#L647 I suspect some state in the virtualenvironment.py module isn't set on first run. I.e. the @tjguk any ideas..? |
I'll mention this as a known bug in the release notes. |
Curiouser and curiouser... Everything seems to be in place in terms of slots going to the right places etc. (And, evidently, it all works fine on the second run). I ran with a (I'm also rather surprised that this hasn't shown up in ad hoc testing previously. The sequence of events which is now failing is typically what I'd have done to test that the pip-install functionality was working. Possible that I haven't in fact done this, but also that something to do with the splash screen functionality is interfering on the first run. Goodness knows why...) I'll keep looking. I can probably produce a workaround by running pip blocking (which seems to work). For most cases you'll hardly notice the difference in timing. |
Just a couple more datapoints: even if I implement a "blocking" version of the unblocked run, by basically running the code to completion and then calling the output` slot, it still doesn't produce the output, all it does complete and the "FINISHED" text appears on the text display. Also, to eliminate the possibility, I tried opening the editor as new, doing no installation, closing it, opening it again and pip-installing -- and that works. So it's not just the first time you try; it's the first time immediately after a new setup. |
(Apologies for the stream of consciousness; I only have bits and pieces of time available so I'm leaving myself a trail to pick up later...) The obvious difference is that the first time we see the Qt thread/parent warning which doesn't appear the second time.
|
Well, that warning always feels a bit of a "niggle" to me... if we can squash it I'll feel like I've balanced my parentheses. My kids are making this evening's family (mothers' day) dinner, so I'll try to get to the cause (if not the fix) of the problem in the next hour or so I have left to me. |
So I think I've found the cause of the Qt warning... which has now thrown up, for the first time, a different Qt warning when we try to call pip install. |
Basically, Running again, that now gives us:
in the |
@tjguk hah.... I just go to that method. Since you're on it, I'll switch to something else (the release / changes docs for tomorrow). |
At risk of muddying waters... the QThread object of the
Not sure why the associated thread is different the third time. |
Ah; that's interesting. I doubt I'll have time to continue the pursuit tonight. I'll try to pick up the threads [*] again tomorrow [*] No pun intended |
I also notice (and probably not relevant, but just saying anyway) that the first two commands are |
Thanks, @ntoll -- there might be something in that. Both ultimately resolve to one of the |
We're both "old hands" at this, so I like how we both acknowledge that it probably shouldn't have any impact, but are open to the potential that it does in some yet-to-fathom manner. |
Key comment from https://stackoverflow.com/questions/17083379/qobjectconnect-cannot-queue-arguments-of-type-int: "If Qt is trying to queue the arguments that means that the connection is between threads. This will not work for non-const references." So we're still implicitly using threads, at least for the initial run. Need to understand why |
... and also useful (since we're trying to append to a QPlainText control via a signal/slot): https://stackoverflow.com/questions/2104779/qobject-qplaintextedit-multithreading-issues |
I did not see any mention of this bug (which I encountered) when reading https://codewith.mu/en/howto/1.1/install_windows (or the Mac version). Perhaps it should be added as a note. After restarting Mu, everything worked as expected (save for the help button [french ui] which leads to a non-existent page.) On the positive side, the "admin" interface with only three tabs is simpler than what I used before (1.1.0.alpha2) and friendly still works :-) Thank you all for your hard work! |
Take the Splash Screen out of the mix, and the problem goes away! (Perhaps unsurprising as the Splash Screen mechanism is the only instance of explicit QThreading we have). I'll come back to this later |
Ok; I've got to dash now, but I think I've got it. (Memo for later: the |
I did the steps suggessted in the screen-grab from OP. I was not able to execute ./run.py. |
FYI @tjguk - I'm going to look into this right now but may drop it if it's a rabbit hole. Reporting for visibility, but I hope the fix is easy (see below).
Start Mu for the first time and then install a new package into the clean venv.
From a clean start, run Mu and allow it to set up a new venv and other assets. Then, without restarting Mu, try to install a package from the admin screen in Python3 mode. Screen-grab of this happening shown below.
I should be able to see the usual installation log and pip should work as expected.
The installation log is just blank. If I restart Mu, it works as expected.
It should work first time... ;-)
other aspects of the context in which Mu was running.
Latest master. I think something like the path to Python or
pip
in the venv is not being set properly on first run such that the admin based install packages widget cannot work.The text was updated successfully, but these errors were encountered: