ContinuumIO / anaconda-issues

Anaconda issue tracking
646 stars 220 forks source link

Solve for "ImportError: DLL load failed: The specified procedure could not be found" for PyQt5.QtWidgets #10079

Open temp89 opened 5 years ago

temp89 commented 5 years ago

Actual Behavior

Fresh install on Win 10 x64 run Anaconda Navigator, Spyder, or try to launch any of the applications and it fails with:

Traceback (most recent call last): File "D:\Python\Scripts\spyder-script.py", line 10, in sys.exit(main()) File "D:\Python\lib\site-packages\spyder\app\start.py", line 190, in main from spyder.app import mainwindow File "D:\Python\lib\site-packages\spyder\app\mainwindow.py", line 80, in from qtpy.compat import from_qvariant File "D:\Python\lib\site-packages\qtpy\compat.py", line 15, in from .QtWidgets import QFileDialog File "D:\Python\lib\site-packages\qtpy\QtWidgets.py", line 22, in from PyQt5.QtWidgets import * ImportError: DLL load failed: The specified procedure could not be found.

After much googling this seems to be a very common issue. Past solutions include the absence of python3.dll (now included in the install) and overly long install directory addresses with non-standard characters. However these solutions do not work for many users.

Given how many inexperienced users are searching for a solution I thought it best to register one here for convenience (and hopefully a fix will be included in the next update).

Fix

On a fresh install, browse to the install directory and enter:

python -m pip install --upgrade pyqt5

Bear in mind this will not work if you ran:

conda update --all

to get the latest versions of all the modules. If you have, then enter:

python -m pip uninstall pyqt5 python -m pip install --upgrade pyqt5

Anaconda or Miniconda version:

Anaconda 5.2 for Python 3.6

WhisperOfHeart commented 5 years ago

I run into this problem also. And fix it by browsing to the install directory and entering: python -m pip install --upgrade pyqt5==5.9 in the Anaconda Prompt by Administer. Directly entering python -m pip install --upgrade pyqt5 will install pyqt5 version>5.10 which may not compatible with others. By the way, I found in the edition Anaconda3-5.2.0-Windows-x86, conda update --all works. And maybe installing x64 Anaconda in win10 x64 will not run into this problem.

norweeg commented 5 years ago

does downgrading your qt version work? edit: nope. Starting to question why I bother with conda anymore. Something always breaks in my environment every time I use it and bugs like this go unpatched for months

norweeg commented 5 years ago

found a solution: Anaconda had to be added to my PATH. Executing my script from anywhere but the Anaconda terminal, even in VS Code with the Anaconda Extension installed and the option to activate the environment in all python terminals set, it was not able to find the Qt installation unless %CONDA_PREFIX%\Library\bin was in my path

sha-fuq commented 5 years ago

found a solution: Anaconda had to be added to my PATH. Executing my script from anywhere but the Anaconda terminal, even in VS Code with the Anaconda Extension installed and the option to activate the environment in all python terminals set, it was not able to find the Qt installation unless %CONDA_PREFIX%\Library\bin was in my path

This solved my issue. Thanks!

SushanthDC commented 5 years ago

When using tensorflow, the ImportError: DLL load failed error, there are many reasons, up from the google.protobuf.pyext import _message error, it should be the protobuf version of the problem,

When tensorflow is automatically installed, protobuf installs the latest version 3.7.1, and there is an incompatibility problem.

Replace with protobuf 3.6.1 (pip install protobuf==3.6.1)

Jichen66 commented 4 years ago

python -m pip install --upgrade pyqt5

this one works for me. Thx @temp89

emaadshamsi commented 4 years ago

Hello, I am a python novice here, and I am running into a similar problem, however it has to deal with PySide2 instead of PyQt5 and I just wanted to know, what is the install directory that you guys are refering to exactly? Is it C:\ProgramData\Anaconda3\pkgs?? Do I just open up the powershell and run the commands you guys mentioned from inside that directory?

I have been running into this DLL load issue forever and I legitimately have no idea how to fix it, this is the closest I have gotten.

titan36 commented 2 years ago

https://github.com/ContinuumIO/anaconda-issues/issues/10079#issuecomment-466903484 Solved my Problem

KeineGosu commented 1 year ago

This solved my problem. Created this account to thank you!

rokm33 commented 1 year ago

conda update --all Solved my problem. Thanks @temp89

EloySerrudo commented 1 year ago

Thank you so much!! "conda update --all" Solved my problem.