本文介绍了如何让python3导入Homebrew安装的图形工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用Homebrew安装图形工具,但是python3找不到它./p>

I tried to use Homebrew to install graph-tool, but the python3 cannot find it.

    brew tap homebrew/science
    brew install graph-tool

据说该软件包安装在homebrew/science/graph-tool-2.22_1,我只在其中找到/usr/local/Homebrew/Library/Taps/homebrew/homebrew-science/graph-tool.rb.

It is said that the package is installed in homebrew/science/graph-tool-2.22_1, where I only found /usr/local/Homebrew/Library/Taps/homebrew/homebrew-science/graph-tool.rb.

当我尝试在python3中导入graph-tool时,它表明from graph_tool.all import *ImportError: No module named 'graph_tool'

When I tried to import graph-tool in python3, it shows thatfrom graph_tool.all import *ImportError: No module named 'graph_tool'

我正在使用python3.

I am using python3.

which python3/usr/local/bin/python3

which python3/usr/local/bin/python3

有没有办法使用Homebrew中安装的graph_tool软件包?

Is there a way I can use the graph_tool package installed in Homebrew?

任何帮助将不胜感激.

推荐答案

另一个对我有用的解决方案是简单地创建一个从图形工具到python侧包的符号链接

Another solution that worked for me is simply creating a symlink from graph-tool to python side packages

ln -s /usr/local/Cellar/graph-tool/2.26_2/lib/python3.6/site-packages/graph_tool /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages

这篇关于如何让python3导入Homebrew安装的图形工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 12:22
查看更多