python-没有名为gtk的模块

为什么我安装gtk& pygtk有自制软件,但是python仍然找不到它:

brew test -v pygtk
Testing pygtk
==> chmod +x test.py
chmod +x test.py 
==> ./test.py
./test.py 
Traceback (most recent call last):
  File "./test.py", line 2, in <module>
    import pygtk
ImportError: No module named pygtk
Error: pygtk: failed

解决方法:

检查模块是否在您的python路径中.检查软件包的安装位置,并将其添加到bashrc中,

#.bashrc        
PATH=$PATH:$HOME/bin:/opt/lib/python2.4/site-packages/psycopg2/:path_to_module
export PATH 

相关文章

最近做自动化测试时,深感自己对前端涉猎太少,加上对这块比...
homebrew本身就是一个git仓库。使用homebrew安装软件包时,会...
一、Homebrew安装、卸载等命令Homebrew的安装和卸载都非常简...
在mac系统中,使用homebrew可以很方便的管理包。按照官网的说...
我按照说明从这里使用brew安装mysqlhttps://gist.github.com...
我在macOS10.12.4上安装了nginx1.10.3和php5.5.38作为开发服...