Hi Jean,
I really appreciate your informative and prompt reply.
Based on your suggestion I used SlicerPython --launcher-show-set-environment-commands
to update the shell environment variables and run python-real
directly
This did bring up the same python version and ucs encoding as the interpreter with python-real
. Unfortunately, within the shell environment, virtualenv
wouldn’t work anymore failing with the error:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Current thread 0x00007fd9b9a95700 (most recent call first):
Aborted
I haven’t done a lot of digging into what is causing this, but will post again if I figure it out. In any case, using virtualenv with the workaround I described above seems a useful / flexible way to install python packages and import them into slicer (including the pre-compiled binary). Maybe that will be helpful to some, as with it I can bring in sklearn, numba, pycuda, scipy, etc…
For now, I haven’t been able to setup a virtualenv with the Slicer’s own python and am stuck having to compile a compatible version from source for the the virtualenv. It is not a terrible solution…