简体   繁体   中英

Why ModuleNotFoundError occurs when trying to run script with PyPy3?

I have a Python script which runs perfectly with CPython (under virtualenv), unfortunately throws ModuleNotFoundError error when I run it with PyPy3 (under virtualenv).

My package is parser and I import Analyze with from parser.Analyze import Analyze . There is parser directory under the same directory with my script. And parser directory has __init__.py file in it too.

Should I do something special for PyPy?

On both PyPy and CPython parser is a built-in module. Can you see if the problem is that the built-in is masking your package? You can rename it to something like myparser . PyPy tracks issues at https://bitbucket.org/pypy/pypy/issues or you can reach out on IRC at #pypy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM