使用 gedit 和 virtualenv 完成 pylons/pyramid 代码
我正在研究金字塔文档,并且非常希望代码完成。我安装了 gedit-plugin-codecompletion
我正在使用 virtualenv
,创建后,我使用 bin/ 文件夹中的“activate”文件来切换终端窗口。当我启动 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'
我对您能帮助我的任何事情都非常感兴趣!
I am working through the pyramid documentation and would really like code completion. I installed gedit-plugin-codecompletion
I am using virtualenv
, once created I use the 'activate' file in the bin/
folder to switch over my terminal window. When I launch gedit
I see these errors:
(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'
Would be very interested in anything you can help me with!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该创建不带 --no-site-packages 参数的 virtualenv,以允许访问系统范围内安装的 python 包。
You should create your virtualenv without
--no-site-packages
argument to allow access to python packages installed system-wide.如果我是你,我就不会在你的 virtualenv 中运行 gedit。如果需要,启动一个新的终端窗口。它看起来比将非开发包安装到 virtualenv 中更干净。
在没有
--no-site-packages
的情况下运行也可以,但有些人认为让 virtualenv 与系统真正隔离是一个好主意,这样您就可以保持它完全隔离并控制 no-site -packages 选项消除了这种隔离。If I were you, I just wouldn't run gedit from within your virtualenv. Start a new terminal window if you must. It just seems cleaner than installing non-development packages into your virtualenv.
Running without
--no-site-packages
could work, but some people think it's a good idea to keep your virtualenv truly isolated from your system so that you can keep it completely isolated and controlled the no-site-packages option removes that isolation.作为第一个想法,我建议您在
env
virtualenv 中运行pip install pygtk
。你尝试过吗?As a first idea, I'd suggest you to run
pip install pygtk
in yourenv
virtualenv. Have you tried it?