Skip to content
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

Anaconda not opening: couldn't find or load Qt platform plugin "Windows in "" #1270

Closed
ignacioarnal1 opened this issue Nov 30, 2016 · 73 comments
Assignees

Comments

@ignacioarnal1
Copy link

ignacioarnal1 commented Nov 30, 2016

Hello, I've been using Anaconda on Windows 10 for the past few months. However, today I tried launching the program and got the following error:

"This application failed to start because it could not find or load the Qt
platform plugin "windows in "".

Reinstalling the application may fix this problem."

I read around about doing 'conda update -all' in cmd, however it didn't
work for me, neither reinstalling Anaconda.

This seems to be a common problem, however I can't seem to find a
straightforward solution online, what can I do? and please bear in mind that
I'm a newbie in Python.

Thanks in advance!

PD: After reading other topics in this forums, I think this information could be useful:

`C:\Users\JoséIgnacio>conda info
Current conda install:

           platform : win-64
      conda version : 4.2.13
   conda is private : False
  conda-env version : 4.2.13
conda-build version : 2.0.11
     python version : 3.5.2.final.0
   requests version : 2.12.1
   root environment : C:\Users\JoséIgnacio\Anaconda3  (writable)
default environment : C:\Users\JoséIgnacio\Anaconda3
   envs directories : C:\Users\JoséIgnacio\Anaconda3\envs
      package cache : C:\Users\JoséIgnacio\Anaconda3\pkgs
       channel URLs : https://repo.continuum.io/pkgs/free/win-64
                      https://repo.continuum.io/pkgs/free/noarch
                      https://repo.continuum.io/pkgs/pro/win-64
                      https://repo.continuum.io/pkgs/pro/noarch
                      https://repo.continuum.io/pkgs/msys2/win-64
                      https://repo.continuum.io/pkgs/msys2/noarch
        config file : None
       offline mode : False`

C:\Users\JoséIgnacio>qmake --version QMake version 3.0 Using Qt version 5.6.0 in C:/Users/JoséIgnacio/Anaconda3/Library/lib

C:\Users\JoséIgnacio>qmake -query QT_SYSROOT: QT_INSTALL_PREFIX:C:/Users/JoséIgnacio/Anaconda3/Library QT_INSTALL_ARCHDATA:C:/Users/JoséIgnacio/Anaconda3/Library QT_INSTALL_DATA:C:/Users/JoséIgnacio/Anaconda3/Library QT_INSTALL_DOCS:C:/Users/JoséIgnacio/Anaconda3/Library/doc QT_INSTALL_HEADERS:C:/Users/JoséIgnacio/Anaconda3/Library/include/qt QT_INSTALL_LIBS:C:/Users/JoséIgnacio/Anaconda3/Library/lib QT_INSTALL_LIBEXECS:C:/Users/JoséIgnacio/Anaconda3/Library/bin QT_INSTALL_BINS:C:/Users/JoséIgnacio/Anaconda3/Library/bin QT_INSTALL_TESTS:C:/Users/JoséIgnacio/Anaconda3/Library/tests QT_INSTALL_PLUGINS:C:/Users/JoséIgnacio/Anaconda3/Library/plugins QT_INSTALL_IMPORTS:C:/Users/JoséIgnacio/Anaconda3/Library/imports QT_INSTALL_QML:C:/Users/JoséIgnacio/Anaconda3/Library/qml QT_INSTALL_TRANSLATIONS:C:/Users/JoséIgnacio/Anaconda3/Library/translations QT_INSTALL_CONFIGURATION: QT_INSTALL_EXAMPLES:C:/Users/JoséIgnacio/Anaconda3/Library/examples QT_INSTALL_DEMOS:C:/Users/JoséIgnacio/Anaconda3/Library/examples QT_HOST_PREFIX:C:/Users/JoséIgnacio/Anaconda3/Library QT_HOST_DATA:C:/Users/JoséIgnacio/Anaconda3/Library QT_HOST_BINS:C:/Users/JoséIgnacio/Anaconda3/Library/bin QT_HOST_LIBS:C:/Users/JoséIgnacio/Anaconda3/Library/lib QMAKE_SPEC:win32-msvc2015 QMAKE_XSPEC:win32-msvc2015 QMAKE_VERSION:3.0 QT_VERSION:5.6.0

@mingwandroid
Copy link

Can you try to install Anaconda in a folder that does not use non-ascii characters?

Also, you say you have done conda update --all, but your Qt version states 5.6.0. Last week we released version 5.6.2, so conda update --all should have got that version for you.

Perhaps try conda update qt and see that it installs 5.6.2?

@jgmorrison
Copy link

I can verify this happens on Windows installations that have spaces or non-ASCII characters in the username regardless of Python2 or Python3. The recent Anaconda-4.3 release does not allow Anaconda to be installed in a path that has spaces or non-ASCII characters anymore.

@mingwandroid
Copy link

It also happens with install prefixes longer than 30 characters, but we will fix that ASAP.

@staplegun
Copy link

I got this after my first ever install of 4.3.0 and tried to open Anaconda Navigator. I don't have non-ASCII characters in the install path.

I opened Anaconda Prompt tried conda update qt (as above) and it complained it wasn't installed. So I tried conda install qt and it worked. I can now open the Navigator.

@ignacioarnal1
Copy link
Author

¡Thanks for your comments!, I 'fixed' the issue by downgrading from Anaconda 4.2.0 to 4.1.1...

I'll stay on that version until the bug is fixed, or change my username to a non ASCII name (easier said than done).

@GolosCD
Copy link

GolosCD commented Feb 4, 2017

Hi.
I have this problem too.

@mingwandroid
Copy link

JuliaPy/PyPlot.jl#278 is not related to this.

@staplegun, @GolosCD, what install location did you use?

@louisalanstevens
Copy link

Seconding the results from Staplegun above. Same problem here with conda 4.3.8 on Windows 10. Opening Anaconda prompt and running conda update qt yielded a PackageNotFoundError but conda install qt solved it and I can run Navigator now. I installed Anaconda3-4.3.0.1-Windows-x86_64 from repo.continuum.io/archive/.

@mingwandroid
Copy link

Hi @GolosCD, @ignacioarnal1, @staplegun, @jgmorrison and @sedulousfunds, would it be possible for you to try: https://repo.continuum.io/pkgs/misc/preview/Miniconda3-4.3.13-Windows-x86_64.exe

It has fixes for both the accented character and also for install locations longer than 30 characters.

It is only a Miniconda (though you can just conda install anaconda afterwards to make it an Anaconda), and only the Python3 version works well (in my testing) at present.

Many thanks for your patience.

@jgmorrison:

I can verify this happens on Windows installations that have spaces or non-ASCII characters in the username regardless of Python2 or Python3. The recent Anaconda-4.3 release does not allow Anaconda to be installed in a path that has spaces or non-ASCII characters anymore.

AFAICT, Anaconda2 has never supported being installed into a install location containing non-ASCII. It's very tricky to write non-ASCII-correct Python2 code, and even if we fix our own software (conda, conda-build, menuinst etc) then the software that our users subsequently install into that installation will often not work correctly, so I'm a bit torn about what to do about that. My current opinion is that the safest thing to do is to advise people who want to do this not to use Python2, but I'd like to get a better understanding of how much stuff is broken first.

@Serkan72
Copy link

I solved same problem using below execution.

COPY the
Continuum\Anaconda3\Library\plugins\platforms
folder to
Continuum\Anaconda3

@ghost
Copy link

ghost commented Apr 22, 2017

It worked for me, thanks @Serkan72

@lgonzalezsa
Copy link

It does not work to me @Serkan72. Using D:\Anaconda path and copied the mentioned files into Anaconda directory but same error.
Any other guidelines?

@wannalearn4fun
Copy link

thanks @Serkan72 solved the issue for me also

BTW there were no spaces, no non-ASCII characters in the path
Anaconda3-4.4.0-Windows-x86
32bit install
Win7 Pro SP1

@chipmuenk
Copy link

Same problem, @Serkan72 solved the issue for me, too. No spaces or non-ASCII characters in the path, Win 7 64 bits, latest Anaconda download. Anaconda has got no rights to access the internet here at work - perhaps this is a part of the problem?

@Abdullah-MARAS
Copy link

Hi,

I have the same problem but unfortunately this solution didn't work for me

@Lauanb
Copy link

Lauanb commented Jul 15, 2017

For those who could not, check if the directory was copied, not only the files.

@jeanhubdes
Copy link

I got same issue and I did conda update --all, in Anaconda prompt, this solved the issue in my case.
W7 64bits.

@6486484
Copy link

6486484 commented Jul 20, 2017

@Serkan72
Worked for me as well. Python installation on a Windows network drive.

@dorbank
Copy link

dorbank commented Jul 27, 2017

my python file runs good. when I try to turn it to a .exe file and run it, I get: "This application failed to start because it could not find or load the qt platform plugin "windows" in "". ".
I used cx_freeze, and I have anaconda 3.5
Any ideas?

@Abdullah-MARAS
Copy link

Abdullah-MARAS commented Jul 27, 2017

I also have problem related to qt. I solved my problem like below.

First I uninstalled everything about anaconda. Then in command interface I run the code below to install qt files. And it worked.

conda install -c anaconda qt=5.6.2

@thethinkingrock
Copy link

@Serkan72
Thanks a lot for the solution.

@ladydavy
Copy link

ladydavy commented Aug 3, 2017

@Serkan72 It works for me. Thanks a lot.

@luigui2906
Copy link

@Serkan72 It works for me your solution.
Thanks bro.

@GilCasale
Copy link

@Serkan72 It works too. Good play !

@soberbia
Copy link

Hi guys, i also had this problem but recently i fixed installing python from source. Before i had Anaconda installed, it´s a great tool for some things but specially in this it causes some troubles and i decided uninstall it completly.

I hope that this work well for you

@mingwandroid
Copy link

Windows can be very tricky and you ran into a DLL-hell conflict and one way to resolve such a conflict is to remove one of the conflicting items. Shame you pick Anaconda Distribution but we cannot fix the Windows DLL loader here.

This is why we specifically discourage adding anything to PATH and would love other software vendors to promote the same advice.

@CarolinaStephanie
Copy link

Hi, i solved just removing the anaconda's lib (all) from the PATH.

@mingwandroid
Copy link

That's fine, we don't recommend adding anything to PATH in the first place, in fact, we explicitly warn against that.

To run our software you should use Anaconda Navigator or the Anaconda Prompt. That way we do not interfere with other software and other software has less chance of interfering with our software.

@Gavinzgz
Copy link

Gavinzgz commented Apr 4, 2018

Thanks for zxr12748 ,I copy the folder
\Anaconda3\Library\plugins\platforms
to
$\venv\Scripts
where $ represents your project dir, because PyCharm calls the python.exe in this dir, not the one in \Anaconda3. and solve my problem !

@ashwaqar
Copy link

@zxr12748 Thank you

That worked perfectly for me.
Copying "platforms" folder to my project directory solved the error.

@jmacura
Copy link

jmacura commented May 24, 2018

Hi there! I have run into this issue just now, while trying to use matplotlib. None of the tips and tricks listed here helped me, until I downgraded the Qt down to the old 5.6.2. Now it works just fine.

@kzwkt
Copy link

kzwkt commented May 24, 2018

i fixed it by adjusting path in qt.conf file located in Anaconda3 root

[Paths]
Prefix =D:/Anaconda3/Library
Binaries =D:/Anaconda3/Library/bin
Libraries =D:/Anaconda3/Library/lib
Headers =D:/Anaconda3/Library/include/qt

@Pechi77
Copy link

Pechi77 commented Jul 16, 2018

I am getting the same issue but from apache, what to do

@IngoKl
Copy link

IngoKl commented Jul 16, 2018

I've found another solution (at least for my specific case). I have installed PySide2 directly from Qt. Copying (and overwriting) all DLLs from Anaconda3\Lib\site-packages\PySide2\plugins\platforms
into Anaconda3/Library/plugins/platforms has solved the issue for me.

@Smsmadly
Copy link

if installed PyQt5 and PySide2, i solved problem
Copy
\Anaconda3\Lib\site-packages\PySide2\plugins\platforms\qminimal.dll
\Anaconda3\Lib\site-packages\PySide2\plugins\platforms\qoffscreen.dll
\Anaconda3\Lib\site-packages\PySide2\plugins\platforms\qwindows.dll
files to
\Anaconda3\Library\plugins\platforms\

@Shimion100
Copy link

If you are using MiKTeX, edit the qt.conf(in the Anaconda base directory), change the Header like:
Headers = E:/Program Files/MiKTeX 2.9/miktex/bin/x64

@YanaXu
Copy link

YanaXu commented Apr 12, 2019

I installed Anaconda and Pycharm.
Run something with seaborn, and meet this problem.
image
I tried all the steps above, but none of them is working...
According to the words of mingwandroid commented on Mar 28, 2018, I open Pycharm in "Anaconda Prompt".
image
The error is gone. Thank God!

@GoingMyWay
Copy link

In Windows, please activate the virtual env, for example, the base

@Antia123
Copy link

Hi, I´m getting the same error when I try to install Anaconda (Python 3.7) on Windows 10. I ran 'conda install qt ' in Anaconda prompt like you but it returns me the message : '
"conda" is not recognized as an internal or external command,
program or executable batch file'.
What can I do to solve this? Do you know?

Thank you in advance!

@antoinesarji
Copy link

I solved same problem using below execution.

COPY the
Continuum\Anaconda3\Library\plugins\platforms
folder to
Continuum\Anaconda3

Totally Works for me

@GutoSchettini
Copy link

I faced this 'qt' issue every time I tried to install Anaconda. Many, many times!. So, Anaconda never worked in my notebook.

I need to install a package using Conda (Iris), so I installed Miniconda. It didn't work (the package installation), but in the error reported it was listed that the Qt was addressed to another installed program (Delft3D from Deltares).

After I removed the Delft3d and manually to delete its directory and contents, restarting the computer, Anaconda finally come to life on my computer!

@liudonghua123
Copy link

Your options are:

  1. Use the Anaconda Prompt to launch pycharm.
  2. Figure out which software you have on your PATH that's got a conflicting Qt5Core.dll (run cmd.exe, enter where Qt5Core.dll), then remove this from PATH (risking breaking whatever software this is).

I think for the next build-out of our Qt libraries I will consider adding a custom prefix to the Qt DLLs as DLL-hell issues with Qt libs comes up a little too often for my liking (mainly due to its popularity).

You saved me a lot of time. In my computer, I have the following envs.

D:\code\python\playground>python power_law_graph.py
qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: direct2d, minimal, offscreen, windows.


D:\code\python\playground>
D:\code\python\playground>where Qt5Core.dll
C:\Program Files\MiKTeX 2.9\miktex\bin\x64\Qt5Core.dll
C:\Users\Liu.D.H\Anaconda3\Library\bin\Qt5Core.dll

D:\code\python\playground>

and after I changed C:\Program Files\MiKTeX 2.9\miktex\bin\x64 priority, now it works.

D:\code\python\playground>where Qt5Core.dll
C:\Users\Liu.D.H\Anaconda3\Library\bin\Qt5Core.dll
C:\Program Files\MiKTeX 2.9\miktex\bin\x64\Qt5Core.dll

D:\code\python\playground>python power_law_graph.py

@phatsp
Copy link

phatsp commented May 7, 2020

Hi, I'm having the same problem. I tried some of the above answers but it didn't work out for me. My PATH is as below, can you tell me what to do. I just learn how to code and don't even know how to handle all these system variable things (I really don't understand some of your answers so I don't know how to follow those solutions)

image

@antlancer-solutions
Copy link

I have the same issue and fixed in this way
In Anaconda installation folder I went to : (change it to your installed path):
C:\ProgramData\Anaconda3\Lib\site-packages\PySide2
Edit this file by adding the following code lines :

below the line 23 type.signature

pyside_package_dir =  os.path.abspath(os.path.dirname(__file__))
dirname = os.path.dirname(__file__)
plugin_path = os.path.join(dirname, 'plugins', 'platforms')
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path

save this file and try again and the issue should be gone :)

@ND-Ha
Copy link

ND-Ha commented Jun 30, 2020

I just found reason why.

It is the difference of the user's name.
image

The file path is below.
\Users\xxxx.conda\env\xxxx\qt.conf

@yu-cheng-kuo-28
Copy link

yu-cheng-kuo-28 commented Jan 28, 2021

I solved same problem using below execution.

COPY the
Continuum\Anaconda3\Library\plugins\platforms
folder to
Continuum\Anaconda3

Worked for me too. Thanks.

@dradamjones
Copy link

I solved same problem using below execution.
COPY the
Continuum\Anaconda3\Library\plugins\platforms
folder to
Continuum\Anaconda3

Totally Works for me

I keep getting this Qt platform error after conda update --all but this solution worked for me too.

@munkey01
Copy link

munkey01 commented Aug 19, 2021

For those who could not, check if the directory was copied, not only the files.

Thanks @Lauanb

I have fought this for days!!! Finally, your comment helped me. I had only moved the contents of the folder.

Copy-Item C:\ProgramData\Anaconda3\Library\plugins\platforms\ C:\ProgramData\Anaconda3\ -Recurse


Edit: Well the issue is almost solved. Now Navigator launches, but all checkboxes and package descriptions show as "..." . Any one have thoughts on this one?


Edit 2: If I try to launch Spyder from terminal, I received the error "Could not find QtWebEngineProcess.exe"...

@deemano
Copy link

deemano commented Mar 24, 2023

For me, the easiest way was to

  1. rename the anaconda3 folder into something else
  2. reinstall Anaconda from the website
  3. copy the old /envs folder content into the new anaconda3/envs

that's all.

@iSantPy
Copy link

iSantPy commented Aug 2, 2023

For me, the easiest way was to

  1. rename the anaconda3 folder into something else
  2. reinstall Anaconda from the website
  3. copy the old /envs folder content into the new anaconda3/envs

that's all.

it worked for me! I just remove Anaconda and reinstall it again from the web

I follow this video: https://www.youtube.com/watch?v=Ul79ihg41Rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests