-
Notifications
You must be signed in to change notification settings - Fork 5
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
Environments not being set correctly #20
Comments
I might see if I can reproduce the issue, but if you want to debug further given you can reproduce it, here are some details that might help. The only thing desktop-app does to "activate" an environment is modify three environment variables, desktop-app/desktop_app/environment.py Line 136 in e26b9cc
env['PATH'] = os.path.pathsep.join(
[
str(prefix),
str(prefix / "Library" / "mingw-w64" / "bin"),
str(prefix / "Library" / "usr" / "bin"),
str(prefix / "Library" / "bin"),
str(prefix / "Scripts"),
env['PATH'],
]
You might try adding some printlines to You might also or instead add printlines to Conda sets other environment variables too, but most aren't needed for running an app, so we don't bother with them. But, it's always possible that has changed. You might want to have a Python script print all environment variables with |
OK, so I have a small update. I added print lines to Conda Name: labscript
Conda Prefix: C:\Users\naqsL\Miniconda3\envs\labscript
Path: C:\Users\naqsL\Miniconda3\envs\labscript;C:\Users\naqsL\Miniconda3\envs\labscript\Library\mingw-w64\bin;C:\Users\naqsL\Miniconda3\envs\labscript\Library\usr\bin;C:\Users\naqsL\Miniconda3\envs\labscript\Library\bin;C:\Users\naqsL\Miniconda3\envs\labscript\Scripts;C:\Users\naqsL\Miniconda3\envs\labscript\bin;C:\Users\naqsL\Miniconda3\condabin;C:\Program Files\Microsoft MPI\Bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files\IVI Foundation\VISA\Win64\Bin;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\TortoiseHg;C:\Program Files\MiKTeX 2.9\miktex\bin\x64;.;C:\BitFlow SDK 6.30\Bin64;C:\BitFlow SDK 6.30\Bin32;C:\Program Files\CameraLink\Serial;C:\Program Files (x86)\CameraLink\Serial;C:\Program Files\FLIR Systems\Spinnaker\bin64\vs2015;C:\Program Files\FLIR Systems\Spinnaker\bin\vs2015;C:\Program Files\Wolfram Research\WolframScript;C:\Program Files\Graphviz\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\dotnet;C:\Users\naqsL\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Andor SDK3;C:\Users\naqsL\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files (x86)\Silicon Laboratories\ClockBuilder Pro\Bin;C:\Program Files\Elmer 9.0-Release\bin;C:\Users\naqsL\AppData\Local\GitHubDesktop\bin Trying to run from base, I still get the same error as before. So I moved the print statements to Conda Name: base
Conda Prefix: C:\Users\naqsL\Miniconda3 What is confusing to me is that this environment has the So I guess this comes down to stupidity with conda environments sometimes finding DLLs in the wrong environments and failing to load if the python versions don't match. Unfortunately this is something I've seen before and it is crazy hard to debug since the failure is difficult to replicate as it necessitates having multiple environments with different python versions. Yuck. Maybe I'll try again to find a repeatable failure mode so I can submit another bug to conda. |
Ah, and it appears that changing to base python version did not fix the actual shortcuts or running from a bare command prompt, which is curious. Checking a little, it appears it finds any random ol' python on the system's path and uses it. Suppose that shouldn't surprise me too much. This computer uses a python that came bundled with an entirely different application. |
This is in relation to a discussion here.
Basically, I have a labscript installation with gui launching shortcuts that used to work. Then one day they stopped working. I saw no indication of what was wrong, but I could launch from the terminal using
python -m blacs
just fine. I spent a little time today looking in to this and I suspect that something hinky is going on with the environment activation. To help me actually get tracebacks, I am running theblacs.exe
instead of theblacs-gui.exe
. For everything below, I've run the executable from the command line in the relevant environmentScripts
directory. I'm running Windows 10 20H2 with a Miniconda installation.blacs.exe
orblacs-gui.exe
from mylabscript
environment (python 3.8.11), everything works.blacs.exe
from the 'base' environment (python 3.7.13), or a bare command prompt, I get the following traceback:Given that part of the point of using desktop-app is so that conda environments are properly activated, I suspect some subtle bug. That said, only one labscript installation of the five I actively run shows this problem, so I'm a little suspicious that it may actually be an issue with conda environments in general (and my one random computer has some random thing about the Miniconda installation that is borking everything, making reproduction of the problem pretty hard).
Anyway, if you can think of obvious tests I can try to get to the bottom of this, I'd be happy to try them out.
The text was updated successfully, but these errors were encountered: