【问题标题】:How do I install heapy under python 2.7?如何在 python 2.7 下安装 heapy?
【发布时间】:2011-10-08 16:44:39
【问题描述】:

好像最新的版本只有2.6。

我正面临ImportError: DLL load failed: The specified module could not be found. 并且找不到任何解决方案,有人知道吗?

还有其他可用于 python 2.7 的内存分析器吗?

错误回溯:

>>> import guppy
>>> from guppy import hpy
>>> h = hpy()

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    h = hpy()
  File "D:\program files\Python2.7\lib\site-packages\guppy\__init__.py", line 37, in hpy
    return r.guppy.heapy.Use
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 45, in __getattr__
    return self._share.getattr(self, name)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 195, in getattr
    d = self.getattr2(inter, cache, owner, name)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 213, in getattr2
    x = self.getattr_package(inter, name)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 261, in getattr_package
    x = self.makeModule(x, name)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 321, in makeModule
    return Share(module, self, module.__name__, Clamp)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 184, in __init__
    getattr(inter, name)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 45, in __getattr__
    return self._share.getattr(self, name)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 195, in getattr
    d = self.getattr2(inter, cache, owner, name)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 215, in getattr2
    x = self.getattr3(inter, name)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 283, in getattr3
    pa = getattr(pa, at)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 45, in __getattr__
    return self._share.getattr(self, name)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 195, in getattr
    d = self.getattr2(inter, cache, owner, name)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 213, in getattr2
    x = self.getattr_package(inter, name)
  File "D:\program files\Python2.7\lib\site-packages\guppy\etc\Glue.py", line 250, in getattr_package
    x = __import__(self.makeName(name), globals(), locals())
  File "D:\program files\Python2.7\lib\site-packages\guppy\heapy\View.py", line 555, in <module>
    prime_builtin_types()
  File "D:\program files\Python2.7\lib\site-packages\guppy\heapy\View.py", line 538, in prime_builtin_types
    import guppy.heapy.heapyc
ImportError: DLL load failed: The specified module could not be found.

【问题讨论】:

    标签: python memory-management memory-leaks


    【解决方案1】:

    当我尝试从 guppy 源文件所在的文件夹启动 python 时,我遇到了同样的错误。但是在这个目录之外,我在实例化 hpy 时遇到了问题。最后,我通过从主干安装 python2.7 开始大量工作

    pip install https://guppy-pe.svn.sourceforge.net/svnroot/guppy-pe/trunk/guppy
    

    【讨论】:

    • 我收到 404“在此服务器上找不到请求的 URL /svnroot/guppy-pe/trunk/guppy。”
    【解决方案2】:

    看起来所需的 dll 可能只是从目录中丢失了 - 您可以尝试将其从 2.6 目录复制到适当的路径中。但不能保证。

    【讨论】:

      【解决方案3】:
      1. https://pypi.python.org/pypi/guppy/0.1.10(或您需要的任何版本)下载源代码
      2. 解压 tar 文件:tar zxf [你的 guppy tar 文件]
      3. 进入文件夹:cd guppy-[version]
      4. 注意 setup.py 文件。运行设置:sudo python setup.py install

      Guppy 已安装。

      【讨论】:

        猜你喜欢
        • 2018-11-25
        • 2011-10-19
        • 2020-07-11
        • 2017-11-21
        • 2011-05-09
        • 1970-01-01
        • 1970-01-01
        • 2019-06-13
        • 2016-08-05
        相关资源
        最近更新 更多