Search code examples
pypy

"No module named _vmprof" error on Mac OS X 10.9.5 + pypy 2.6


I duplicated the question from here, hope there's more visibility, thanks :) https://github.com/vmprof/vmprof-python/issues/24

Hi all, When I run

#pypy -m vmprof test.py
No module named _vmprof; 'vmprof' is a package and cannot be directly executed

Another case:

#vmprofshow 
Traceback (most recent call last):
  File "<builtin>/app_main.py", line 75, in run_toplevel
  File "/vmprofshow", line 9, in <module>
    load_entry_point('vmprof==0.1.3', 'console_scripts', 'vmprofshow')()
  File "/site-packages/pkg_resources.py", line 352, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/site-packages/pkg_resources.py", line 2307, in load_entry_point
    return ep.load()
  File "/site-packages/pkg_resources.py", line 2021, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/site-packages/vmprof/__init__.py", line 7, in <module>
    import _vmprof
ImportError: No module named _vmprof

My environment:

  • mac os x 10.9.5
  • pypy 2.6

Thanks a lot :)


Solution

  • vmprof on PyPy is only enabled on 64-bit Linux right now. The documentation at https://vmprof.readthedocs.org/en/latest/ is misleading: the beta versions of vmprof on OS/X or FreeBSD are only available for CPython, not for PyPy.