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

Workbench crashes when anaconda is on the PATH #1643

Open
phargogh opened this issue Oct 9, 2024 · 2 comments
Open

Workbench crashes when anaconda is on the PATH #1643

phargogh opened this issue Oct 9, 2024 · 2 comments
Assignees
Labels
bug Something isn't working workbench For issues relating to the workbench front-end of invest

Comments

@phargogh
Copy link
Member

phargogh commented Oct 9, 2024

A student in the InVEST class was unable to launch the InVEST workbench on Windows, and the workbench logfile looked like this:

[17:57:52.975] [C:\Program Files\InVEST 3.14.2 Workbench\resources\app.asar\build\main\main.js] Windows detected, requesting single instance lock
[17:57:53.030] [C:\Program Files\InVEST 3.14.2 Workbench\resources\app.asar\build\main\main.js] Running invest-workbench version 3.14.2
[17:57:56.008] [C:\Program Files\InVEST 3.14.2 Workbench\resources\app.asar\build\main\main.js] Found invest binaries "C:\Program Files\InVEST 3.14.2 Workbench\resources\invest\invest.exe" for version 
[17:57:56.017] [C:\Program Files\InVEST 3.14.2 Workbench\resources\app.asar\build\main\main.js] Started python process as PID 13576
[17:57:56.338] [C:\Program Files\InVEST 3.14.2 Workbench\resources\app.asar\build\main\main.js] retry # 1
[17:57:56.398] [C:\Program Files\InVEST 3.14.2 Workbench\resources\app.asar\build\main\main.js] Traceback (most recent call last):
  File "osgeo\__init__.py", line 30, in swig_import_helper

[17:57:56.399] [C:\Program Files\InVEST 3.14.2 Workbench\resources\app.asar\build\main\main.js]   File "importlib\__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 921, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 813, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1289, in create_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
ImportError: DLL load failed while importing _gdal: The specified procedure could not be found.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "invest\cli.py", line 16, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "natcap\invest\datastack.py", line 35, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "osgeo\__init__.py", line 35, in <module>
  File "osgeo\__init__.py", line 32, in swig_import_helper
  File "importlib\__init__.py", line 90, in import_module
ModuleNotFoundError: No module named '_gdal'
[1380] Failed to execute script 'cl
[17:57:56.399] [C:\Program Files\InVEST 3.14.2 Workbench\resources\app.asar\build\main\main.js] i' due to unhandled exception!

The specific PATH entries that were preventing InVEST from launching were:

  • C:\Program Files\Anaconda\Scripts
  • C:\Program Files\Anaconda\Library\bin
  • C:\Program Files\Anaconda\condabin

When the student removed all three of these entries (I do not know if they tested each one individually), the workbench was able to launch.

A few other observations about the student's system:

  • Windows 11
  • The user's username had all ascii characters and no spaces, e.g. C:\Users\phargogh\
  • There were no gdal-related environment variables defined
  • There was a PYTHONPATH environment variable defined, but it appeared to refer to a chemistry workspace, and so was unlikely to have affected this situation.

The student had a username that was entirely ASCII character

@phargogh phargogh added the bug Something isn't working label Oct 9, 2024
@phargogh
Copy link
Member Author

#1610 is related since it'd be helpful to inspect the cause of the error without having to dig into the logs directory.

@davemfish davemfish added the workbench For issues relating to the workbench front-end of invest label Oct 15, 2024
@davemfish davemfish self-assigned this Oct 21, 2024
@davemfish
Copy link
Contributor

davemfish commented Oct 21, 2024

I tried reproducing this on a Windows VM and was not able to. I first installed Anaconda, which placed about 5 different paths on my user's PATH, then I installed and ran the Workbench. I did not get any import errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workbench For issues relating to the workbench front-end of invest
Projects
None yet
Development

No branches or pull requests

2 participants