+-
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 
点击查看更多相关文章

转载注明原文:python-没有名为gtk的模块 - 乐贴网