Python Pygtk min virtualenv无法安装
我正在尝试通过pip在GNU/Linux机器上安装pygtk,并使用新创建的virtualenv。我尝试使用以下命令通过pip安装pygtk:Python Pygtk min virtualenv无法安装,python,pygtk,Python,Pygtk,我正在尝试通过pip在GNU/Linux机器上安装pygtk,并使用新创建的virtualenv。我尝试使用以下命令通过pip安装pygtk: pip install pygtk 但我得到了以下错误: Using cached pygtk-2.24.0.tar.bz2 Complete output from command python setup.py egg_info: ***************************************************
pip install pygtk
但我得到了以下错误:
Using cached pygtk-2.24.0.tar.bz2
Complete output from command python setup.py egg_info:
********************************************************************
* Building PyGTK using distutils is only supported on windows. *
* To build PyGTK in a supported way, read the INSTALL file. *
********************************************************************
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-qcLrwN/pygtk/
此外,我还看到了以下问题:
但在我的道路上仍然没有光明
Edid 1:
我在终端上键入了以下命令行:
mkvirtualenv pygtkexample --system-site-packages
workon pygtkexample
sudo apt-get install libgtk-3-dev
pip install pygtk
我仍然会遇到同样的错误。好吧。正如错误告诉你的,你不能在Linux中以这种方式构建PyGTK 您可以使用virtualenv-system site软件包创建您的环境,然后在安装了pip install-ignore的情况下安装您希望在此特定环境中使用的其他软件包,因为这些软件包在本地的优先级将高于系统范围的软件包 或者,您可以手动从git克隆并构建GTK 如果您使用的是VirtualNVRapper类型: 作为解决方法,您可以尝试放弃在venv中安装GTK,方法是使用以下方法手动导入系统范围的软件包:
import sys
sys.path.append("/usr/lib/python2.7/dist-packages/gtk")
创建了一个没有系统站点包的Virtualenv。只需将PYTHON_PATH环境变量设置为以下值:
export PYTHON_PATH=$VIRTUAL_ENV/bin/python
之后安装:
pip install vext.pygtk
然后通过命令
pip freeze > requirements.txt
您可以将其放入系统的需求中。我如何使用VirtualEnvrapper实现这一点VirtualEnvrapper只是virtualenv的包装器。不应该完全不同,对吗?https://saurabh-kumar.com/blog/virtualenv-vs-virtualenvwrapper.html 为您提供一篇很好的博客文章,将VirtualEnvrapper的优点添加到virtualenv中,这样您就不再需要添加的层了想法是您不再需要安装pygtk。。
pip freeze > requirements.txt