我刚刚尝试在 Debian 4.7 服务器上安装 Dexy。安装了 Python 但没有安装 pip,所以我做了一些研究并找到了如何操作:
$ python --version
Python 2.7.3
$ sudo apt-get install python-setuptools
(...)
$ sudo easy_install pip
(...)
所有这些步骤都顺利,所以我可以开始安装 dexy :
$ sudo pip install dexy
(...)
==========================================================================
WARNING: The C extension could not be compiled, speedups are not enabled.
Plain-Python installation succeeded.
==========================================================================
Running setup.py install for web.py
Successfully installed dexy pexpect BeautifulSoup4 PyYAML cashew chardet inflection jinja2 ply pygments python-modargs requests dexy-viewer Markdown docutils markupsafe web.py
Cleaning up...
好的,除了“C 扩展”警告外,一切看起来都很好(我不是 Python 专家,但“成功安装 dexy”消息让我感到乐观)
然而,当我启动 dexy 时,出现了致命错误:
$ dexy setup
Traceback (most recent call last):
File "/usr/local/bin/dexy", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2707, in <module>
working_set.require(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 686, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: requests>=0.10.6
我在网上查了一下,但一无所获。我该怎么办?
(旁注:我在 Stackoverflow 网站上确实拥有很多声誉(4000+),但在超级用户上却没有,所以我现在无法创建新的“Dexy”标签。我是否在正确的网站上发布这个问题?)
答案1
哦,我刚刚找到了一个方法!
我刚刚直接使用 easy_install 安装了 dexy(再次)
$ sudo easy_install dexy
Searching for dexy
Best match: dexy 1.0.14
Adding dexy 1.0.14 to easy-install.pth file
Installing dexy script to /usr/local/bin
(...)
Installed /usr/local/lib/python2.7/dist-packages/chardet-2.2.1-py2.7.egg
Finished processing dependencies for dexy
现在,看上去不错!
$ dexy setup
$ dexy
didn't find any document config files (like dexy-env.json dexy.txt dexy.yaml)
dexy run finished in 0.093
dexy reports finished in 0.109
我希望两种方式安装都不会太麻烦...:/