omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    ptpython anyone?

    Pythonista
    2
    4
    2963
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MikeBeard
      MikeBeard last edited by

      Has anyone tried to install Jonathan Slenders awesome ptpython to Pythonista?

      I was able to get it installed through StaSh, but the main install script didn't get installed. When I looked at what it actually did on my desktop, thought it should be easy, but ...

      Here is what the code looks like:

      import re
      import sys
      
      from ptpython.entry_points.run_ptpython import run
      
      if __name__ == '__main__':
          sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
          sys.exit(run())
      

      But when I run it, I get "Error: No module named entry_points.run_ptpython" even though I can find the correct package in the site-package directory.

      Anyone have a idea of what I might try?

      Thanks!
      Mike

      1 Reply Last reply Reply Quote 0
      • MikeBeard
        MikeBeard last edited by

        So was trying several things, to no avail. Then I thought I'd just see if I could import the package in the console and see what I get.

        Interesting:

        >>> import ptpython
        
        >>> import ptpython.entry_points
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
        ImportError: No module named 'ptpython.entry_points'; 'ptpython' is not a package
        

        It doesn't have an issue with the top package name ('ptpython'), but it does to any other under that.

        Does this ring a bell to anyone? Is there anything that I could try?

        Thanks,
        Mike

        1 Reply Last reply Reply Quote 0
        • tlinnet
          tlinnet last edited by

          Maybe the import of an (possible) init.py is not working.

          (See: https://docs.python.org/2/tutorial/modules.html#packages)

          If you can live without "import ptpython.entry_points", then just
          continue with "import ptpython"

          1 Reply Last reply Reply Quote 0
          • MikeBeard
            MikeBeard last edited by

            Thanks tinnet! I'll give that a go and see what I can figure out. I should look at the init.py files as well.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors