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

Using Anaconda as embedded Python Interpreter does not work on Windows without setting PYTHONHOME #151

Closed
pscff opened this issue Sep 22, 2021 · 2 comments · Fixed by #152

Comments

@pscff
Copy link
Collaborator

pscff commented Sep 22, 2021

Testing the Windows build in #150 (comment) fails for several tests related to the embedding of the Anaconda Python interpreter

The following tests FAILED:
	 26 - test_storage (Failed)
	 38 - test_mapping (Failed)
	 39 - test_pyembed (Failed)
	 40 - test_python_mapping (Failed)
	 49 - test_json_storage (Failed)
	 52 - test_yaml_storage (Failed)

Windows Anaconda Python version used:

$ python
Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.

The typical error is

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
52: Python runtime state: core initialized
52: ModuleNotFoundError: No module named 'encodings'

This is an Anaconda issue:

A temporary workaround is to explicitly set PYTHONHOME in the test environment. This works for the base as well as for interpreters installed in a virtual environment.

@pscff pscff linked a pull request Sep 22, 2021 that will close this issue
@pscff
Copy link
Collaborator Author

pscff commented Sep 22, 2021

The fix makes test 39 "test_pyembed" pass on Windows.

The following tests are still failing:

The following tests FAILED:
         26 - test_storage (SEGFAULT)
         38 - test_mapping (Failed)
         40 - test_python_mapping (SEGFAULT)
         49 - test_json_storage (SEGFAULT)
         52 - test_yaml_storage (SEGFAULT)

@pscff
Copy link
Collaborator Author

pscff commented Sep 30, 2021

The failing tests are fixed in the windows-compile branch (with the exception of test 38 test_mapping)

@pscff pscff closed this as completed Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant