Pypy not working, python works…

Member Site Forums PyRosetta PyRosetta – General Pypy not working, python works…

Viewing 3 reply threads
  • Author
    • #2231

        Hi all,

        I’m getting the following error when trying to run my script with pypy. I can run the script fine with python 2.7.9.

        File “”, line 75, in run_toplevel
        File “”, line 22, in
        from toolbox import cleanATOM
        File “”, line 35, in

        import rosetta
        File “”, line 21, in

        import utility
        File “”, line 1, in >
        from __utility_all_at_once_ import *
        ImportError: No module named __utility_all_at_once_

        The file “__utility_all_at_once_.pyd” is there in that folder but it doesn’t seem to work, and yet it works fine with no changes with regular python. I understand there are different namespaces with pypy, yet paths seems to be ok…

        Any ideas appreciated


      • #10862

          PyPy uses a different interpreter than the standard “CPython” system. This means that modules which are not pure python which are compiled for the standard python system don’t (quite) work with the PyPy interpreter. As notes: “C extensions need to be recompiled for PyPy in order to work.”

          However, there are ways around it. The page notes several, including the Reflex option, which from my preliminary reading might work – I don’t know if anyone has tried it with Rosetta yet, though. Note that you would use that with the regular Rosetta source download, rather than the pre-wrapped PyRosetta download, as the cppyy/Reflex system is doing the wrapping for you.

          If you try it, please let us know how it works.

        • #11108

            Did this resolve your issue @MarkW

            please let me know!

            Ashish Gupta
            Web Dev

          • #11169

              Well kind of! It gave an explanation for what was going on, but the solution looked too time consuming for what I wanted to do. Instead, I used ctypes to speed up sections that I identified with profiling as slow (mainly random number generation) and got some speed up there. I have also been using multiple cores simultaneously to crunch through the calcs quicker as well. So as of now I haven’t gone any further with pypy

            • #10863

                Thx for the prompt reply.

                A bit more involved than I hoped for at the moment! I am re-writing the various functions for searching, fragment insertion, small mover (all now done) with rotamer packing and loops still to do, all in Pyrosetta/python. As performance is always an issue I hoped the pypy method would be a simple and obvious one. The old rule, nothing is simple gets applied again here by the looks of it. I’ll revisit it another time when I get the rest of the stuff working.

                Thx again for the info


            Viewing 3 reply threads
            • You must be logged in to reply to this topic.