ContinuumIO / anaconda-issues

Anaconda issue tracking
648 stars 221 forks source link

CMD error in anaconda "failed to start because it could not find or load the Qt platform plugin" while anaconda prompt works fine #7766

Open Sdnzr opened 6 years ago

Sdnzr commented 6 years ago

Hello. both qt and PyQt is installed in anaconda directories. when i run my program through anaconda prompt, it runs fine and doe sense qt. but when i run it through cmd its not. i tried adding an env variable to miktex qt. also tried adding variables to platform, plugin, lib ..it didnt work. pls help. ____- F:\SUAVE\tutorials\Tutorials-1.0.2\Tutorials-1.0.2>python tut_solar_uav.py This application failed to start because it could not find or load the Qt platform plugin "windows" in "".

Available platform plugins are: minimal, offscreen, windows.

Reinstalling the application may fix this problem.

and then the python crashes. to find a work around. i deleted qtconfig file in anaconda directory, and found the same error in anaconda prompt as well. so it is able to sense this file and find qt directories..which contains this _____-- [Paths] Prefix = C:/Users/Saad/Anaconda2/Library Binaries = C:/Users/Saad/Anaconda2/Library/bin Libraries = C:/Users/Saad/Anaconda2/Library/lib Headers = C:/Users/Saad/Anaconda2/Library/include/qt

So cmd is unable to find qt in anaconda directory,,,,,,,,,,so how to fix this??????

ccordoba12 commented 6 years ago

You need to add the directory where Qt DLLs are placed to your PATH environment variable to fix this.

mingwandroid commented 6 years ago

@ccordoba12, actually it is more complicated than this. On Windows there are two types of path env vars, system and user. The actual final path puts system before user.

This is why we no longer recommend users to select the add to path option in the installers on Windows.

I'm sorry but the correct answer here is to use the Anaconda Prompt.

ccordoba12 commented 6 years ago

Thanks for the clarification @mingwandroid!