cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
<marcel422>
Hi. I am just starting with pypy and tried to run my python application with pypy. There is one problem I cannot fix: pypy fails to import my local packages. I use pypy 7.3.4 (which is python 3.7.10). Everything works perfectly when I use python 3.7.10 with cpython. In my main file I do "from parser import Parser", where "parser" is a local python package and with pypy I get "ImportError: cannot import name 'Parser'". I would be so ha
<marcel422>
@arigato: No. The package failing to import is not a dependency. It is a local package inside my project.
<arigato>
but "parser" is also the name of a standard module, so I think the error is that pypy is finding the standard module, which doesn't have a Parser class in it
<marcel422>
@arigato. Oh. So you mean just changing the name of my parser package would fix it?
<arigato>
likely. but it's strange that your package hides the standard module on CPython but not on PyPy
<marcel422>
@arigato. Thank you so much. It works. Yes indeed. I was didn't think about this possibility at all as it worked just fine with CPython
<arigato>
it's even a built-in module (not just a standard module) in CPython, I thought these were not shadowable
<arigato>
I cannot make "import parser" find a local package in CPython 3.7
<arigato>
it always finds the built-in module for me
<arigato>
ah, found a different machine with a different OS where "parser" is not a built-in but standard module---and there, you can
<arigato>
so the complete answer is that what you did works with *some* installations of CPython but not others
<cfbolz>
🎉
<fijal>
hah
<fijal>
great
<marcel422>
@arigato. Never ever would I have fixed this without your answer ^^ - thanks
<arigato>
you're welcome. the hint was the error message that said "cannot find name xyz inside module 'parser'", i.e. "I could import a module 'parser' but it looks like it's not the right one"