3

我正在研究金字塔文档,并且非常希望代码完成。我安装了gedit-plugin-codecompletion

我正在使用virtualenv,一旦创建,我使用文件夹中的“激活”文件bin/来切换我的终端窗口。当我启动时,gedit我看到这些错误:

(env)agd@hephaestus:~/Dev/projects/LearningPyramid$ gedit 

** (gedit:11418): WARNING **: Error initializing Python interpreter: could not import pygtk.

** (gedit:11418): WARNING **: Please check the installation of all the Python related packages required by gedit and try again.

** (gedit:11418): WARNING **: Cannot load python plugin Python 'Bracket Completion' since gedit wasnot able to initialize the Python interpreter.

** (gedit:11418): WARNING **: Error loading plugin 'Bracket Completion'

** (gedit:11418): WARNING **: Cannot load python plugin Python 'Evolved Code Completion' since gedit wasnot able to initialize the Python interpreter.

** (gedit:11418): WARNING **: Error loading plugin 'Evolved Code Completion'

对您可以帮助我的任何事情都非常感兴趣!

4

3 回答 3

2

您应该创建不带 --no-site-packages参数的 virtualenv 以允许访问安装在系统范围内的 python 包。

于 2011-04-27T14:44:16.143 回答
1

如果我是你,我不会在你的 virtualenv 中运行 gedit。如果必须,启动一个新的终端窗口。它似乎比在你的 virtualenv 中安装非开发包更干净。

没有运行--no-site-packages可能会工作,但有些人认为让您的 virtualenv 与您的系统真正隔离是一个好主意,这样您就可以保持它完全隔离和控制 no-site-packages 选项消除了这种隔离。

于 2011-05-04T15:52:44.973 回答
0

作为第一个想法,我建议你pip install pygtk在你的envvirtualenv 中运行。你试过了吗?

于 2011-04-27T13:45:27.563 回答