Python on a mac: how to build pythonw?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ron Garret

    Python on a mac: how to build pythonw?

    I'm trying to run the Python examples distributed with XCode and they
    all give me the same error:

    Traceback (most recent call last):
    File "checktext. py", line 35, in <module>
    main()
    File "checktext. py", line 8, in main
    pathname = EasyDialogs.Ask FileForOpen(mes sage='File to check
    end-of-lines in:')
    File "/usr/local/lib/python2.5/plat-mac/EasyDialogs.py" , line 650, in
    AskFileForOpen
    _interact()
    File "/usr/local/lib/python2.5/plat-mac/EasyDialogs.py" , line 53, in
    _interact
    AE.AEInteractWi thUser(50000000 )
    MacOS.Error: (-1713, 'no user interaction is allowed')

    Googling reveals that the answer is to use pythonw, but there is no such
    thing installed on my system:

    [ron@mickey:~]$ pythonw
    -bash: pythonw: command not found

    Apparently, pythonw didn't get built when I installed Python 2.5, and I
    can't find any instructions on how to build it. (The installation
    instructions don't seem to mention it.)

    If anyone could spare a clue I would be most grateful.

    Thank,
    rg
  • Robert Kern

    #2
    Re: Python on a mac: how to build pythonw?

    Ron Garret wrote:
    I'm trying to run the Python examples distributed with XCode and they
    all give me the same error:
    >
    Traceback (most recent call last):
    File "checktext. py", line 35, in <module>
    main()
    File "checktext. py", line 8, in main
    pathname = EasyDialogs.Ask FileForOpen(mes sage='File to check
    end-of-lines in:')
    File "/usr/local/lib/python2.5/plat-mac/EasyDialogs.py" , line 650, in
    AskFileForOpen
    _interact()
    File "/usr/local/lib/python2.5/plat-mac/EasyDialogs.py" , line 53, in
    _interact
    AE.AEInteractWi thUser(50000000 )
    MacOS.Error: (-1713, 'no user interaction is allowed')
    >
    Googling reveals that the answer is to use pythonw, but there is no such
    thing installed on my system:
    >
    [ron@mickey:~]$ pythonw
    -bash: pythonw: command not found
    >
    Apparently, pythonw didn't get built when I installed Python 2.5, and I
    can't find any instructions on how to build it. (The installation
    instructions don't seem to mention it.)
    It looks like you built Python yourself. The default build does not allow you to
    communicate with the Apple GUI. You need a framework build. I highly recommend
    that you simply use the binary on www.python.org instead of building from
    source. If you do want to build from source, please read the file Mac/README for
    instructions.

    Note that in recent versions of Python, I believe that the pythonw executable is
    no longer necessary as a workaround.

    --
    Robert Kern

    "I have come to believe that the whole world is an enigma, a harmless enigma
    that is made terrible by our own mad attempt to interpret it as though it had
    an underlying truth."
    -- Umberto Eco

    Comment

    • Ron Garret

      #3
      Re: Python on a mac: how to build pythonw?

      In article <mailman.4582.1 172771922.32031 .python-list@python.org >,
      Robert Kern <robert.kern@gm ail.comwrote:
      Ron Garret wrote:
      I'm trying to run the Python examples distributed with XCode and they
      all give me the same error:

      Traceback (most recent call last):
      File "checktext. py", line 35, in <module>
      main()
      File "checktext. py", line 8, in main
      pathname = EasyDialogs.Ask FileForOpen(mes sage='File to check
      end-of-lines in:')
      File "/usr/local/lib/python2.5/plat-mac/EasyDialogs.py" , line 650, in
      AskFileForOpen
      _interact()
      File "/usr/local/lib/python2.5/plat-mac/EasyDialogs.py" , line 53, in
      _interact
      AE.AEInteractWi thUser(50000000 )
      MacOS.Error: (-1713, 'no user interaction is allowed')

      Googling reveals that the answer is to use pythonw, but there is no such
      thing installed on my system:

      [ron@mickey:~]$ pythonw
      -bash: pythonw: command not found

      Apparently, pythonw didn't get built when I installed Python 2.5, and I
      can't find any instructions on how to build it. (The installation
      instructions don't seem to mention it.)
      >
      It looks like you built Python yourself.
      Yep. I'm a do-it-yourself kind of guy :-)
      The default build does not allow you to
      communicate with the Apple GUI. You need a framework build. I highly
      recommend
      that you simply use the binary on www.python.org instead of building from
      source. If you do want to build from source, please read the file Mac/README
      for instructions.
      Okeydokey.
      Note that in recent versions of Python, I believe that the pythonw executable
      is no longer necessary as a workaround.
      How recent? I'm already using 2.5.

      Thanks!
      rg

      Comment

      • Robert Kern

        #4
        Re: Python on a mac: how to build pythonw?

        Ron Garret wrote:
        In article <mailman.4582.1 172771922.32031 .python-list@python.org >,
        Robert Kern <robert.kern@gm ail.comwrote:
        >Note that in recent versions of Python, I believe that the pythonw executable
        >is no longer necessary as a workaround.
        >
        How recent? I'm already using 2.5.
        2.5 definitely works. I think it might have been one of the Universal builds of
        2.4 where it started working, but my memory is a bit hazy on that point.

        --
        Robert Kern

        "I have come to believe that the whole world is an enigma, a harmless enigma
        that is made terrible by our own mad attempt to interpret it as though it had
        an underlying truth."
        -- Umberto Eco

        Comment

        • Ron Garret

          #5
          Re: Python on a mac: how to build pythonw?

          In article <mailman.4583.1 172773764.32031 .python-list@python.org >,
          Robert Kern <robert.kern@gm ail.comwrote:
          Ron Garret wrote:
          In article <mailman.4582.1 172771922.32031 .python-list@python.org >,
          Robert Kern <robert.kern@gm ail.comwrote:
          >
          Note that in recent versions of Python, I believe that the pythonw
          executable
          is no longer necessary as a workaround.
          How recent? I'm already using 2.5.
          >
          2.5 definitely works.
          Yes, once you know the magic incantation:

          ../configure --enable-universalsdk

          :-)

          rg

          Comment

          • Robert Kern

            #6
            Re: Python on a mac: how to build pythonw?

            Ron Garret wrote:
            In article <mailman.4583.1 172773764.32031 .python-list@python.org >,
            Robert Kern <robert.kern@gm ail.comwrote:
            >
            >Ron Garret wrote:
            >>In article <mailman.4582.1 172771922.32031 .python-list@python.org >,
            >> Robert Kern <robert.kern@gm ail.comwrote:
            >>>Note that in recent versions of Python, I believe that the pythonw
            >>>executable
            >>>is no longer necessary as a workaround.
            >>How recent? I'm already using 2.5.
            >2.5 definitely works.
            >
            Yes, once you know the magic incantation:
            >
            ./configure --enable-universalsdk
            Actually, --enable-framework is the relevant flag for this feature. You should
            use both, of course.

            --
            Robert Kern

            "I have come to believe that the whole world is an enigma, a harmless enigma
            that is made terrible by our own mad attempt to interpret it as though it had
            an underlying truth."
            -- Umberto Eco

            Comment

            Working...