performance - Plon:checkinterval 无法导入 pystone

标签 performance python-2.7 plone gil plone-4.x

我找到了the hint about using checkinterval in the Plone documentation (用于性能调整)并尝试安装它;在我的 buildout.cfg 中:

[buildout]
parts +=
    checkinterval

[checkinterval]
recipe = zc.recipe.egg
eggs =
    jarn.checkinterval

但是,当我在构建后尝试调用 bin/checkinterval 时,失败了:

  File ".../eggs/jarn.checkinterval-1.0-py2.7.egg/jarn/checkinterval/checkinterval.py", line 4, in <module>
    from test import pystone
ImportError: cannot import name pystone

我查看了 jarn.checkinterval 包,既没有找到 test 模块,也没有找到任何需求规范。

我尝试将test添加到部件列表中,以及pip install test等;但我发现的 test 包不包含字符串 pystone

那么,我在哪里可以找到这个 pystone 实用程序,以及如何集成它才能找到它?

或者这个 checkinterval 东西已经过时了吗?

最佳答案

Pystone 应该在你的 python 中而不是你的 Plone 中。要检查这一点,只需找出您正在使用的 python 并测试导入,如下所示:

$ head -2 bin/buildout
#!/home/daniel/dev/Plone/Development/myproject/bin/python

$ /home/daniel/dev/Plone/Development/myproject/bin/python
Python 2.7.5 (default, Jul 15 2013, 18:40:50) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from test import pystone
>>> 

在您的系统上可能会失败。

您使用哪个平台? This fedora user's problem与您的类似,只需通过 yum install python-test 即可解决。希望这对你来说是那么容易吗?

如果你使用通用安装程序安装了 Plone,它应该会为你构建一个 python(我认为)包含这样的依赖项......

关于performance - Plon:checkinterval 无法导入 pystone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31026685/

相关文章:

plone - 灵活地移动现有的字段/行为

performance - 在客户端计算机上执行第三方编译的程序

html - 应用渐变的图像 : better performance adding gradients via css or apply them directly to the src img?

python OCR : Converting Scanned Image Into Text For Processing

Python文件读取倒带

plone - 如何知道结果大脑是基于原型(prototype)还是基于灵巧的对象?

java - 如何查明导致 Android 应用程序变慢的原因

python - 如何使 while 迭代更快?

Python 正则表达式匹配字符串中间

python - Plone/IRelatedItems - 如何以编程方式设置灵巧内容类型的 relatedItems?