spack: Spack-built Python: ImportError: No module named _io
Has anyone seen this error message before?
$ /Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/bin/python
Python 2.7.10 (default, Jul 30 2016, 19:40:32)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import io
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: No module named _io
It occurs for me on develop, but only on macOS. It’s definitely new, as I’ve never seen it before. @davydden?
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 15 (15 by maintainers)
According to the Python developers:
Removing
--enable-sharedfrom the build solves the problem. I think this is the best way to go, at least on macOS. Unfortunately, adding--enable-frameworkcausesmake installto fail and I don’t know why.@adamjstewart: For what it’s worth, this was the error I was getting before #1435 was merged. The problem was that user configuration was getting in the way and causing shared libraries (e.g.
_io.so) from being installed in the Python Spack directory. It may be worthwhile to check and see if_io.sois located in/path/to/spack/python/lib/python2.7/lib-dynloadand to figure out what could be redirecting it if it isn’t present.