简体   繁体   English

Enthought的Canopy找不到Python GTK模块

[英]Python GTK module not found with Enthought's Canopy

In the simple code 在简单的代码中

import gtk 导入gtk

class GettingStarted: 类入门:

 def __init__(self): window = gtk.Window() window.show() 

GettingStarted() 入门()
gtk.main() gtk.main()

I receive an import error at the lines 我在行上收到导入错误

from glib._glib import * 从glib._glib导入*

_PyGLib_API = _glib._PyGLib_API _PyGLib_API = _glib._PyGLib_API

DLL load failed: The specified module could not be found. DLL加载失败:找不到指定的模块。

For background, I am running 64bit windows7 and using 64bit canopy and I got my modules here: http://www.lfd.uci.edu/~gohlke/pythonlibs/ 对于背景,我正在运行64位Windows7并使用64位顶篷,并且在这里获取了模块: http : //www.lfd.uci.edu/~gohlke/pythonlibs/

I downloaded the following 64bit files into the site-packages folder accompanied by Canopy 我将以下64位文件下载到Canopy随附的site-packages文件夹中

C:...\\AppData\\Local\\Enthought\\Canopy\\User\\Lib\\site-packages\\ C:... \\ AppData \\ Local \\ Enthought \\ Canopy \\ User \\ Lib \\ site-packages \\

pygtk-2.22.0, pygtk-2.22.0,

pygobject-2.28.6, pygobject-2.28.6,

pycairo-1.10.0, pycairo-1.10.0,

python-dateutil-1.5, python-dateutil-1.5,

pyparsing-2.0.1, pyparsing-2.0.1,

numpy-1.7.1, numpy-1.7.1,

matplotlib-1.3.1rc2 matplotlib-1.3.1rc2

The last 4 packages that you list are already in Canopy. 您列出的最后4个软件包已在Canopy中。 I do not recommend replacing them. 我不建议更换它们。

The first 3 packages that you list should be installed by running them (the download files are executables) not by copying them into site-packages. 您列出的前三个软件包应通过运行它们(下载文件是可执行文件)来安装,而不是通过将其复制到站点软件包中来安装。 Before you execute them, be sure that you have made Canopy be your default Python or they will install into whatever Python is your default. 在执行它们之前,请确保已将Canopy设置为默认的Python,否则它们将安装到默认的Python中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM