ImportError: No module named 'encodings'
While the error is self explaining, I know the cause of the issue. The problem is that the platform is using colon in their path name so when I set the path using:
And then call:
It fails to find the required modules to import. So, my question is: Is there any way to workaround without renaming the path (which I'm not controlling)? Can I somehow escape the colons?
From the looks of the <a href="http://hg.python.org/cpython/file/8fe2bb0c5851/Modules/getpath.c#l823" rel="nofollow">source code</a>, there is no way to do this that I can see...
Py_SetPath simply clears out any path that may have been set previously and then resets it to the string you give it with no real processing. That is what gets returned by
Py_GetPath and that's all there is to it I suppose.
One suggestion that <em>might</em> work is to create a symbolic link to the directory somewhere where there isn't a
: in the path name and use that instead ...