cooperjaXC / windows-python-venv

Wrangling python virtual environments for Windows 10/11 workflows
Apache License 2.0
0 stars 0 forks source link

Anaconda-based python interpreters can't import `spnego` #4

Open cooperjaXC opened 1 year ago

cooperjaXC commented 1 year ago

A common error when setting the base python interpreter in set_python_path.bat is the ImportError "DLL load failed while importing _ssl: the specified module could not be found." This seems to occur for Anaconda-based python interpreters.

In limited testing, errors arise from the spnego python package, and it especially occurs when trying to include the package arcgis in the venv requirements.

cooperjaXC commented 1 year ago

This StackOverflow resource suggests it is

libcrypto-1_1-x64.dll libssl-1_1-x64.dll

that should be copied from python/Library/bin to python/DLLs. I’m hopeful that this is the only solution we need, but I’m in troubleshooting/testing mode with this.

Note that the DLL files may have a different version than the 1_1 listed in the StackOverflow article but should still be considered the target DLL files to move.

cooperjaXC commented 1 year ago

This StackOverflow resource suggests it is

libcrypto-1_1-x64.dll libssl-1_1-x64.dll

that should be copied from python/Library/bin to python/DLLs. I’m hopeful that this is the only solution we need, but I’m in troubleshooting/testing mode with this.

Note that the DLL files may have a different version than the 1_1 listed in the StackOverflow article but should still be considered the target DLL files to move.

This solution worked in a recent test case. Keep in mind that you need admin permissions to execute this copy-and-paste, but this should be scriptable. At the very least, add it to the README so users know what to do if it can't be automated. And maybe add a note in the code if it's running on an Anaconda python interpreter that this may need to happen for venvs to work correctly.