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
SimpleITK is not available on Windows if Slicer is installed in a path that contains special characters #5383
Comments
Will this be fixed if we just update to a newer version of Python? |
I see related fixes in Python-3.10, so probably the definitive solution will be to upgrade to that. A workaround is to type this into the Python console before entering Simple Filters module (or before trying to use SimpleITK anywhere): import sys
sys.path.append(slicer.app.applicationDirPath()+'/../lib/Python/Lib/site-packages/SimpleITK-2.0.1-py3.6-win-amd64.egg') As a workaround, we could add paths listed in By the way, even Microsoft seems to run into trouble due to this (see for example https://docs.microsoft.com/en-us/office/troubleshoot/office-suite-issues/username-contains-special-character), and I expect that many other software will have problems, too. |
@jcfr What do you think? |
I have not tried 3.9 or the current 3.10-alpha. I would’ve tried using the PRs mentioned in #5014, but there is currently only the potential for build success with 3.8. |
I started working on updating python-cmake-buildsystem, we are long overdue for an update. |
I've tried a stock Python-3.6.7 and it determined sys.prefix correctly, even if parent folder contained special characters. So, most likely the issue is that Slicer uses UTF-8 process code page and Python does not expect this. Maybe more recent Python versions are better prepared for this. Maybe some build options are available? In general, switching Python from codepages to UTF-8 seems to be an ongoing debate, with lots of pushback from CPython core developers (worrying about backward compatibility): https://discuss.python.org/t/pep-597-enable-utf-8-mode-by-default-on-windows/3122/58. So, I'm not sure if a good solution exist at all or we need to patch CPython. |
New user report: https://discourse.slicer.org/t/open3d-pip-install-issue/16377 |
We should check this again after we switched to the pip-installed (not self-built) SimpleITK. |
SimpleITK is not available if Slicer is installed in a path that contains special (non-ASCII) characters.
The reason is that CPython 3.6 on Windows does not correctly compute "sys.prefix" if the path contains non-ASCII characters, therefore
lib\Python\Lib\site-packages\easy-install.pth
is not found (which adds./simpleitk-2.0.0-py3.6-win-amd64.egg
to the search path at startup) and so SimpleITK's egg is not found.Steps to reproduce
import SimpleITK
in the Python console => SimpleITK module is not foundPrefix folder path can be printed using these commands:
Expected behavior
SimpleITK should be found.
Environment
The text was updated successfully, but these errors were encountered: