-
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
PyQt -- ImportError: DLL load failed: The specified module could not be found #354
Comments
Just to confirm my reading of this...
|
I had the same problem in #300, however since in that machine I was using a version of virtualenv that was probably a couple of years old, I wrongly assumed it was an old bug likely fixed already. As I like to use virtualenvwrapper what I ended up doing was manually copy the python3.dll file to the virtualenv directory. It's very hackish, but does the job until this is fixed properly. We should add a note to the docs and keep this issue opened until there is a new release with the fix. |
@ntoll yes to both. I think that people (like @carlosperate ) who choose to use one of the venv wrappers are assumed to know what they're about. It might be worth an FAQ to say that "to fix [the ImportError] copy the python3.dll" (which is what I did as well!) |
Aha... understood. Since I've never encountered this error, I'm not quite sure what exactly I should be writing and where. It would be really helpful if someone could add the right thing to the right place in the docs (sorry). |
I'll add something to the docs -- when I work out where! |
In here perhaps..? https://github.com/mu-editor/mu/blob/master/docs/setup.rst |
(cf mu-editor#354) The current version of virtualenv (15.1) does not copy python3.dll into the venv created. But the latest Qt modules link to python3.dll. The stdlib venv module does copy python3.dll and we're only supporting 3.5+ so venv will always be present
I'm getting this same error on Windows 7 when using the windows installer:
To reproduce:
Looking at the included files, both
|
Can you run under procmon? Should be able to spot which DLL is being sought. |
BTW I note you're running a 32-bit install. Is it possible we've captured the wrongly-bitted DLLs? (Just a thought) |
It was working with the installer... I'll take a look. |
Here is the procmon log: |
Huh... so that's a list of NAME NOT FOUND and PATH NOT FOUND errors. Do those files exist? I notice you appear to have used the installer to install Mu just for you, rather than for all users (i.e. in "Program Files"). Could this be a source of problems..? Also, what happens if you uninstall and reinstall it..? (Just curious) |
I don't have time to pick up the log right now, but the way Python's import mechanism works generates a lot of NAME/PATH NOT FOUND as it scans sys.path and then the system PATH looking for modules and .DLLs. So lots of NOT FOUND is somewhat expected. |
Ahh, good to know. Thanks @tjguk for explaining. This is very much in the Twilight Zone of my Windows knowledge. ;-) |
Yes, my first instict was to change it to all users, but I though I should try the default option, which is just for the current user. This is also likely the option that requires no lower admin rights to install. Uninstalled and reinstalled: Same result |
@carlosperate thank you for going through this pain, and so sorry to have inflicted it upon you! :-/ You appear to be using the same sort of VM to me when I was checking the installer was working. I wonder what's different. I'll try to take a look this afternoon. |
No worries, I was just trying to replicate #373 and trying in Windows 7 in case there was also CRT dll issues. While the two issues might not be caused by the same problem it's probably a matter of figuring out missing dlls and both could be debugged and fixed at the same time. |
I just remembered that I recently bumped the version of Qt up a minor "notch". I wonder if that may be causing the problem. I'll revert it back to what it was and re-test this afternoon (once I've finished what I'm doing this morning!). ;-) |
On the surface, looks like it's this: @carlosperate can you check whether the KB update mentioned there is applied to your box? |
OK... so I found several gremlins in the Windows packaging where there was a mismatch between the different versions of Qt related things. I've fixed it all up and tested both 32bit (on Windows 7) and 64bit (on Windows 10) and they work for me (tm). ;-) Please try the latest builds of master and let me know. |
Tried https://s3-eu-west-2.amazonaws.com/mu-builds/windows/mu_2018-03-08_13_52_master_981c909_32bit.exe (latest build at the time or writing) and I have the same problem:
|
hmm... so what's different about your Windows and mine (Windows 7, 32bit) while installing exactly the same package. :-/ |
Forgot to say, I just tried the package you reference with no issues whatsoever. :-/ sigh computers are frustrating... |
Probably the Windows CRT (it's like the VC++ redistributables for applications built against the newest SDK) as suggested by @tjguk. This was also the main reason we had to stick with Python 3.4 (and the last PyQt for Py3.4) when using PyInstaller. |
As far as I can tell, if you have an up-to-date Windows, everything works. I've tested on Windows 7 and 10. I think it reasonable that our users keep their OS up-to-date. |
This is not categorised as "important" update, but an "Optional/Recommended" update, so we cannot count on all Windows 7/8/8.1 users with an up-to-date OS to have this installed. However, I will agree that the % of users in this category will be relatively small. If this Universal CRT is the problem, the solution would be to ensure all required DLLs are packed with Mu. A lot of these are already included, as shown in #354 (comment), so maybe it's just a matter of finding out what might be missing. I will also point out that we haven't really confirmed yet if this issue is indeed caused by the Windows CRT. The Microsoft provided Windows 7 virtualbox image is not an unresonable windows configuration, so we do have an issue. However, we can cross that brigde when we come to it, we might not have any users affected. |
Well, in the (upcoming)new website, the instructions will say that we expect users to have up-to-date systems including recommended updates. Quite understand that it's not confirmed caused by Windows CRT, but, try as I might, I can't reproduce this problem with the available Windows I have (which all happen to be up to date). |
It's good to see WIndows robustly working for me, no matter how hard I try to make it break. :-P |
@ntoll We got a report about Mu crashing on startup on several of their computers and found the error to be this one.
It was fixed by installing the Windows Universal CRT package from https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows. However, this problem can be specially unfriendly as it presents itself as the application refusing to launch and there aren't any errors shown. There is a small line in the website about using an up-to-date version of Windows:
But to be completely honest, and this is just an opinion without any empirical data, I would guess most people feel comfortable enough running a Windows installer, that they are unlikely to carefully read these instructions, and much less to extrapolate from this that they need to update Windows, or enable the recommended updates. If you install something in a in-working-order computer and Mu is the only application that fails to launch the first assumption for most people would probably have is that problem is within Mu and not the OS. We should probably add more details about this required Windows update in the installation instructions, but I do wonder if that's enough, as I'm not sure how visible it is there. Apart from all this, looking at pynsist it seems like it is already bundling some of these files and that it copies the DLLs along the app when necessary (this is for Python itself to run): |
Attempting to start Mu in a virtualenv on Windows gives an ImportError. NB this does not happen with a stdlib venv.
From within a fresh clone on Windows:
This is because QtCore (and other Qt extensions) are linked to python3.dll rather than to python36.dll. The released versions of virtualenv (15.1 as I write) do not copy this file over. virtualenv master has a fix for this (cf pypa/virtualenv#1083) but no released version has this fix.
The stdlib venv module does copy this file, so the advice is: use python -mvenv on Windows
The text was updated successfully, but these errors were encountered: