Page 1 of 1

[RESOLVED] Anaconda

Published: September 15, 2020 - 08:12
by davidbkk
Good morning,

I have a problem with Anaconda3-2020.07-Windows-x86_64; it installs perfectly on all the identical machines (we just deployed them), but on some, for some unknown reason, Anaconda does not launch with the error: "This application failed to start because it could not find or load the Qt platform plugin "windows". Reinstalling the application may fix this problem.".

The only way to solve this problem is to launch a conda cmd with admin rights with the command "conda install qt", there is a prompt asking for y/n which must be passed for the command to succeed.

My question is: how do I add this to the end of the Anaconda installation in my script, but more importantly, how do I pass the y/n prompt to cmd?
Or another solution, perhaps a Qt package...

Thank you for your help

Here is my script if needed.

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []

# raccourcis
RaccourcisPathExe = r'C:\ProgramData\Anaconda3\pythonw.exe'
RaccourcisArguments = r'C:\ProgramData\Anaconda3\cwp.py C:\ProgramData\Anaconda3 C:\ProgramData\Anaconda3\pythonw.exe C:\ProgramData\Anaconda3\Scripts\anaconda-navigator-script.py'
RaccourcisArguments1 = r'C:\ProgramData\Anaconda3\cwp.py C:\ProgramData\Anaconda3 C:\ProgramData\Anaconda3\pythonw.exe C:\ProgramData\Anaconda3\Scripts\spyder-script.py'
RaccourcisDossier = "_LFIB MATHS"
RaccourcisName = u"Anaconda Navigator (Anaconda3)"
RaccourcisName2 = u"Spyder (Anaconda3)"
RaccourcisName3 = u"Anaconda Powershell Prompt (Anaconda3)"
RaccourcisName4 = u"Anaconda Prompt (Anaconda3)"
RaccourcisName5 = u"Jupyter Notebook (Anaconda3)"
RaccourcisName6 = u"Reset Spyder Settings (Anaconda3)"
RaccourcisDossierProgramm = r"C:\ProgramData\Anaconda3"
ExeName = 'pythonw.exe'
ExeName2 = 'pythonw.exe'
def install():
    if os.path.isdir('C:\ProgramData\Anaconda3') == False:
        install_exe_if_needed("Anaconda3-2020.07-Windows-x86_64.exe",'/InstallationType=AllUsers /RegisterPython=1 /S',key='',min_version='2020.02')
    else:
        print ('Anaconda already install')

    print('Creation du lien dans le menu demarrer _LFIB MATHS')
    #create_programs_menu_shortcut(RaccourcisName,target=RaccourcisPathExe,arguments=RaccourcisArguments,icon=r'C:\ProgramData\Anaconda3\pkgs\anaconda-navigator-1.9.12-py38_0\info\recipe\navigator.ico',folder=RaccourcisDossier)
    #create_programs_menu_shortcut(RaccourcisName2,target=RaccourcisPathExe,arguments=RaccourcisArguments1,icon=r'C:\ProgramData\Anaconda3\pkgs\spyder-4.1.4-py38_0\Scripts\spyder.ico',folder=RaccourcisDossier)
    copytree2(r'icone',r'c:\ProgramData\Microsoft\Windows\Start Menu\Programs\_LFIB MATHS')

def uninstall():
    print('uninstalling Anaconda')
    run(r'"C:\ProgramData\Anaconda3\Uninstall-Anaconda3.exe" /S')

    print('Supression du lien dans le menu demarrer _LFIB MATHS')
    remove_programs_menu_shortcut(RaccourcisName,folder=RaccourcisDossier)
    remove_programs_menu_shortcut(RaccourcisName2,folder=RaccourcisDossier)
    remove_programs_menu_shortcut(RaccourcisName3,folder=RaccourcisDossier)
    remove_programs_menu_shortcut(RaccourcisName4,folder=RaccourcisDossier)
    remove_programs_menu_shortcut(RaccourcisName5,folder=RaccourcisDossier)
    remove_programs_menu_shortcut(RaccourcisName6,folder=RaccourcisDossier)
Config:
Debian 10
Wapt 1.8.2
Windows 10 x64

Re: Anaconda

Published: September 18, 2020 - 3:27 PM
by jpele
Good morning,

On the first launch of Anaconda, it seems to install these dependencies. I imagine that without them it fails to launch, but to install dependencies you need administrator privileges since the installation takes place in Program Files.
We therefore need to find a solution to install the prerequisites during the installation process. I've found a first lead, which still needs to be tested. Here is the code:

Code: Select all

# Chemin à adapter : "C:\Program Files\Anaconda3\Scripts\activate.bat"
run('"%s"' % makepath(app_dir,'Scripts','activate.bat'))
Sources:
https://github.com/ContinuumIO/anaconda ... +the+Qt%22
https://github.com/ContinuumIO/anaconda ... sues/10309

Sincerely,
Jimmy

Re: Anaconda

Published: September 18, 2020 - 3:38 PM
by jpele
Davidbkk,

My first answer is probably a bad lead.
The command that should resolve the issue is:

Code: Select all

conda install qt --quiet --offline --use-local --yes
Source : https://docs.conda.io/projects/conda/en... stall.html

I'll see about integrating all of this into the Store package ;)

Sincerely,
Jimmy

Re: Anaconda

Published: September 21, 2020 - 03:59
by davidbkk
Hello,

thank you for your reply. How do I integrate these commands into an Anaconda shell?

Re: Anaconda

Published: September 21, 2020 - 2:12 PM
by jpele
Hello,

By "integrating these commands into an Anaconda shell," do you mean integrating the command into the WAPT package?

If so, it's relatively complex because it involves modifying the Python environment during the WAPT package deployment.
I was able to integrate the relevant part into the WAPT Store package; I suggest you adapt your package based on it, or vice versa. Here it is:

https://store.wapt.fr/store/tis-anaconda3

Regards,
Jimmy

Re: Anaconda

Published: September 22, 2020 - 4:31 AM
by davidbkk
Thank you very much, I will indeed take your package.