McCode
McCode copied to clipboard
mcgui 3.4 windows issue
Hi, there is an issue with the GUI not running both from shortcut and the shell.
C:\Users\user>mcgui
Traceback (most recent call last):
File "C:\mcstas-3.4\lib\tools\Python\mcgui\mcgui.py", line 15, in
Tried updating to latest python version and installing PyQt5 but no luck so far (windows). Thanks!
Hi @pkaracosta
Sorry for not getting back to you before, have been busy running a McStas school. :)
If I remember correctly you may have an Anaconda Python installed “globally” on your Windows machine?
(I.e. try starting a normal cmd.exe shell and write python --version
to see if this is the case?)
If this is the case, very likely the “embedded” Python brought along with the installation of McStas 3.4 is likely colliding with that Python version - and the cure/workaround is potentially as simple as renaming your folder c:\mcstas-3.4\miniconda3
to something else, e.g. c:\mcstas-3.4\miniconda3gone
Try this and see what happens?
(We may have to install McStas dependencies to your "system" Python - the list is available here: https://github.com/McStasMcXtrace/McCode/blob/main/environment.yml)
Best,
Peter
Thanks Peter, this solved it!! Best, Petroula
Great! I will see what can be done to avoid this problem going forward with McStas 3.5.
Hey there,
I seem to have the exact same problem. I wanted to upgrade to McStas 3.4 from 3.3 and now i get the same error message when trying to start the gui from the shell. The thing is i get the same problem with version 2.7.2 that i downloaded just to check, but in version 3.3 the gui works fine. I tried renaming the folder c:\mcstas-3.4\miniconda3 but that also didnt work.
Best Augustin
@GustiLoesch quite certain there is a clash between "system" Python ( Anaconda? ) and the embedded one in your McStas.
I have three possible workarounds for you:
- Try replacing your miniconda3 folder with the content of the zip file found here: https://tmp.mcstas.org/Windows/
- Install WSL and use McStas through that - see https://github.com/McStasMcXtrace/McCode/blob/main/INSTALL-McStas-3.x/Windows/WSL/README.md
- If you can live without NCrystal and MCPL support you may also simply try installing (the experimental !!) McStas 3.x packages from conda-forge, follow the instructions at https://github.com/conda-forge/mcstas-suite-feedstock
Best of luck Peter
Thank you :) The first workaround fixed it. Just out of curiosity, what is different to the miniconda folder that comes with the metapackage from the Installation via Github?
@GustiLoesch good to hear!
That installation was made on a machine where I was certain no other Python was present at install time. (I believe we are looking at a problem of detecting Qt "already available" on the surrounding system but linked to / matching another Python version...)
@GustiLoesch and @pkaracosta I have reworked the installation procedure, you may try it out via the outputs of this GitHub worker run: https://github.com/McStasMcXtrace/McCode/actions/runs/9536639410
(Windows installer is included in the "ubuntu" artefact as it a cross-compile)