我正在使用 1.10 版本的网状包( R 版本是 3.5.1 ),我想将其配置为使用 pyenv python (路径是 /Users/name/.pyenv/versions/hak/bin/python )。运行 py_config() 不会显示此 python 可用:
python: /usr/bin/python
libpython:
/System/Library/Frameworks/Python.
framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
pythonhome:
/System/Library/Frameworks/Python.
framework/Versions/2.7:/System/Library
/Frameworks/Python.framework/Versions/2.7
version: 2.7.10 (default, Oct 6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
numpy: /System/ Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
numpy_version: 1.8.0
python versions found:
/usr/bin/python
/usr/local/bin/python
/usr/local/bin/python3
因为我的 pyenv python 不可用,所以我在提到的路径上设置了 RETICULATE_PYTHON env 变量。但现在我得到了错误
初始化 python(required_module, use_environment) 时出错:
Python shared library
'/Users/name/.pyenv/versions/3.6.5/lib/libpython3.6.dylib'
not found, Python bindings not loaded.
有人知道如何解决这个问题吗?
默认情况下,pyenv 不使用可共享库构建 python。确保它确实设置了 CONFIGURE_OPTIONS 变量或在您的前面加上pyenv build $VERSION
命令如下例所示:
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.7.5
see:
https://github.com/pyenv/pyenv/blob/master/plugins/python-build/README.md#building-with---enable-shared) https://github.com/pyenv/pyenv/blob/master/plugins/python-build/README.md#building-with---enable-shared)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)