failed to import at pyenv's user
Created by: Qero
I install vissualdl by pip, but I get the fatal error when import it in my pyenv local environment
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import visualdl
Fatal Python error: PyThreadState_Get: no current thread
[1] 60591 abort python
Then, I found the core.so in versions/2.7.14/lib/python2.7/site-packages/visualdl, and it is depends on the /usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/Python, it isn't match my python environment.
➜ visualdl git:(master) otool -L core.so
core.so:
@rpath/core.so (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
Now it works, but I must change dependence by hand.
➜ visualdl git:(master) install_name_tool -change /usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/Python /Users/*****/.pyenv/versions/2.7.14/lib/libpython2.7.dylib core.so
Moreover, u may not find .pyenv/versions/2.7.14/lib/libpython2.7.dylib, u should rebuild ur python environment with "--enable-shared". For example
export PYTHON_CONFIGURE_OPTS="--enable-shared"
pyenv install 2.7.14