在我的生活中,我无法让 AppTrace 在我的 Google App Engine 开发服务器(OSX 10.8.2 上的 Python 2.7)上运行,主要是因为:
ImportError: dlopen(/apptrace/guppy/sets/setsc.so, 2): Symbol not found: __PyLong_AsScaledDouble
Referenced from: /apptrace/guppy/sets/setsc.so
Expected in: flat namespace in /apptrace/guppy/sets/setsc.so
这类似于以下问题,除了问题是询问在 GAE 上进行分析/监控的最佳方式,并且接受的答案没有解决 ImportError 问题: Memory profiling/monitoring (python) on Google AppEngine
我也从 Guppy 的跟踪器上看到了这个信息,但它仍然没有解决问题: http://sourceforge.net/tracker/?func=detail&aid=3047282&group_id=105577&atid=641821
当我直接从主干获得 0.1.9 版本时,这是我的输出:
pip install https://guppy-pe.svn.sourceforge.net/svnroot/guppy-pe/trunk/guppy
Downloading/unpacking https://guppy-pe.svn.sourceforge.net/svnroot/guppy-pe/trunk/guppy
Downloading guppy
Checking out https://guppy-pe.svn.sourceforge.net/svnroot/guppy-pe/trunk/guppy to /var/folders/w7/k0q671gx6hb03_rl_tmcnkq80000gn/T/pip-JA8fuK-build
Running setup.py egg_info for package from https://guppy-pe.svn.sourceforge.net/svnroot/guppy-pe/trunk/guppy
Cleaning up...
这输出比 Guppy 跟踪器声明的要少得多。但是,如果我运行 python -c 'import guppy; import guppy.sets' 我仍然得到与以前相同的 ImportError。
我远不是 python 甚至 OSX 专家,所以任何关于可能配置不正确或可能指向错误位置的建议都会有所帮助。谢谢
最佳答案
成功了!基本上,当我使用这些说明安装 Guppy 时: http://code.google.com/p/apptrace/wiki/UsingApptrace
我的 OSX 10.8 不是使用 GCC 4.2 构建的。我不得不更新自制软件以使用 GCC 4.2 构建:
brew update
brew tap homebrew/homebrew-dupes
brew install apple-gcc42
我能够从这篇文章中找到答案: https://superuser.com/questions/400179/gcc-on-os-x-lion-with-xcode-4-3-1
关于python - 在 OSX 10.8.2 上使用 Python 2.7 获取适用于 Google App Engine 的 AppTrace,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13189297/