0

我正在 ubuntu karmic 9.10 上实现 reddit.com 源代码。

我已经完成了所有步骤,并且在我使用 paste 命令的一个步骤中它会引发错误。$paster 外壳示例.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 ImportError:没有名为 rails.asset_tag 的模块

我已经检查了 webhelpers 的版本,它是最新安装的。

谁能告诉我通过安装另一个版本的 webhelpers 可以解决这个问题?

或者我应该修改代码吗?

它是使用 pylons 框架用 python 编写的 reddit.com 源代码。

我无法决定是否通过安装任何以前版本的 webhelpers 来帮助或修改代码。

如果有人实施了 reddit.com 网站,请帮助我或建议我最好的方法。

感谢新航

4

1 回答 1

1

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 or sys.path variables.

The documentation linked above has more info on how to control the module search path.

于 2010-02-24T17:32:44.187 回答