我正在 ubuntu karmic 9.10 上实现 reddit.com 源代码。
我已遵循所有步骤,但在使用 Paster 命令的一个步骤中,它会引发错误。
$paster shell example.ini
文件“/usr/local/lib/python2.6/dist-packages/Pylons-0.9.6.2-
py2.6.egg/pylons/middleware.py”,第 11 行,在
从 webhelpers.rails.asset_tag 导入 javascript_path
导入错误:没有名为rails.asset_tag的模块
我已经检查了webhelpers的版本,它是最新安装的。
有人可以告诉我通过安装另一个版本的 webhelpers 可以解决这个问题吗?
或者我要修改代码吗?
它是用 python 编写的 reddit.com 源代码,使用 pylons 框架。
我无法决定安装任何以前版本的 webhelpers 是否有帮助,或者我是否应该修改代码。
如果有人已经实现了 reddit.com 网站,请帮助我或建议我最好的方法。
谢谢
新航
I am implementing the reddit.com source code on ubuntu karmic 9.10.
I have followed all the steps and in one step where i am using paster command it throws an error.
$paster shell example.ini
File "/usr/local/lib/python2.6/dist-packages/Pylons-0.9.6.2-
py2.6.egg/pylons/middleware.py", line 11, in
from webhelpers.rails.asset_tag import javascript_path
ImportError: No module named rails.asset_tag
I have checked for the version for webhelpers, its the latest installed.
Could anybody tell me that by installing another version of webhelpers will solve this problem?
Or Shall i modify the code?
Its a reddit.com source code written in python, using pylons framework.
I am unable to decide that whether by installing any previous version of webhelpers helps or shall i modify the code.
If there is anybody who have implemented the reddit.com website please help me or suggest me the best way.
thanks
SIA
发布评论
评论(1)
您需要确保 Reddit 克隆所需的所有库都位于 Python的模块搜索路径。有很多不同的方法可以实现这一点。最简单的可能是使用 setuptools'
easy_install
命令进行安装(尽管这是我个人最不喜欢的安装 Python 库的方式,并且还会以“为什么不使用 分发 或pip 代替?")。下一个最简单的方法可能是下载并解压您需要的库的源代码,然后 a)
setup.py install
它们或 b) 将它们的目录添加到您的$PYTHONPATH
或 sys.path 变量。上面链接的文档提供了有关如何控制模块搜索路径的更多信息。
You need to ensure that all the libraries needed by your Reddit clone are on Python's module search path. There are a lot of different ways to accomplish this. The easiest is probably to just use setuptools'
easy_install
command to install them (though this is my own personal least favorite way to install Python libraries, and also opens new cans of worms in the form of "Why not use distribute or pip instead?").The next easiest way is probably to download and unpack the source code for the libraries you need and either a)
setup.py install
them or b) add their directories to your$PYTHONPATH
orsys.path
variables.The documentation linked above has more info on how to control the module search path.