[英]Building graph-tool on OSX with Python 3.4
我尝试使用自制软件在Mac OSX 10.10上安装图形工具。 brew构建过程工作正常,但是当我尝试导入图形工具时,我得到了这个问题中描述的错误 。 自制软件的另一个问题是我总是为python2.7构建图形工具,并将软件包安装在Python 2.7 sit-packages文件夹中。 但我想在Python 3.4中使用它。 这些是我尝试从源代码构建图形工具的原因。
./configure
命令也自动使用Python 2.7。 所以我用./configure PYTHON=python3.4
传递了所需的Python版本
然后它会检测正确的版本以及相关路径,但会因以下错误而崩溃:
配置:错误:
无法将测试程序链接到Python。 也许主要的Python库已经安装在一些非标准的库路径中。 如果是,请通过LDFLAGS环境变量将其传递给configure。
示例:./ configure LDFLAGS =“ - L / usr / non-standard-path / python / lib”================================================== ====================错误! 您可能必须为您的发行版安装Python包的开发版本。 这个包的确切名称因其而异。
================================================== ====================
使用和不使用PYTHON
变量时会发生错误。 从./configure
的输出我可以看到一切正常,除了最后一行,它说:
检查python开发环境的所有组件的一致性...没有
上述行是什么意思,我如何在我的机器上正确安装图形工具?
该错误消息说明需要做什么 。 由于python安装在非标准路径中,因此需要传递指向python库所在目录的标志LDFLAGS="-L/usr/non-standard-path/python/lib"
。 如果您使用自制软件,这很可能是"/usr/local/lib"
。
当我尝试使用过时的autoconf
/ automake
/ pkg-config
组合(使用CentOS 5.10中的yum
安装)安装graph-tool
时,我收到此错误。 从源代码安装这些软件包修复了问题...虽然我不确定这与我的python安装有什么关系....
它通过传递变量PYTHON_EXTRA_LDFLAGS="-Wl,-stack_size,1000000 -F/usr/local/Cellar/python3/3.6.3/Frameworks -framework CoreFoundation"
。
在您的情况下,它将是homebrew
的python3.4
安装的python3.4
。
我发现的方法是在config.log
,错误消息显示以下内容:
configure:19023: checking python extra libraries
configure:19030: result: -ldl -framework CoreFoundation
configure:19037: checking python extra linking flags
configure:19044: result: -Wl,-stack_size,1000000 -framework CoreFoundation Python.framework/Versions/3.6/Python
configure:19051: checking consistency of all components of python development environment
configure:19079: gcc -o conftest -g -O2 -DNDEBUG -I/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/include/python3.6m -F/usr/local/Cellar/python3/3.6.3/Frameworks/ -Wl,-stack_size,1000000 -framework CoreFoundation Python.framework/Versions/3.6/Python conftest.c -L/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib -lpython3.6m -ldl -framework CoreFoundation -ldl -framework CoreFoundation >&5
clang: error: no such file or directory: 'Python.framework/Versions/3.6/Python'
错误似乎是路径'Python.framework/Versions/3.6/Python'
,在homebrew
安装中不存在。 我在config.log
搜索相同的路径,我找到了这一行:
PYTHON_EXTRA_LDFLAGS="-Wl,-stack_size,1000000 -framework CoreFoundation Python.framework/Versions/3.6/Python"
所以,我的解决方案是用正确的路径传递这个变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.