Python Light Revisted?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ramza Brown

    Python Light Revisted?

    This is kind of funny, I posted earlier about a small, light python
    distro. The thing is, I did it in an hour or so, but amazingly, I got
    responses from everywhere asking for support on how to do this. To be
    honest, I don't have the time to investigate it more. My point, there
    seems to be a lot of interest for a lightweight python app, but no real
    resources on how to do it?

    The goal, build python(mainly for win32) so that the ENTIRE install is
    maybe less than 5MBs and includes possibly a GUI library, possibly
    TwistedMatrix, possibly install from just unzipping an archive like
    applications such as Eclipse.

    So, my question, has anybody done this similar to what I did? I can
    show you how I did it, but it was so quick, I didnt really think about
    what libraries I included.

    There are mini linuxes out there, I suggest mini pythons.

    Why? For example, I don't need an XML-RPC library, or zip library, or
    the other libraries.



    --
    Ramza from Atlanta

  • Ramza Brown

    #2
    Re: Python Light Revisted?

    Ramza Brown wrote:[color=blue]
    > This is kind of funny, I posted earlier about a small, light python
    > distro. The thing is, I did it in an hour or so, but amazingly, I got
    > responses from everywhere asking for support on how to do this. To be
    > honest, I don't have the time to investigate it more. My point, there
    > seems to be a lot of interest for a lightweight python app, but no real
    > resources on how to do it?
    >
    > The goal, build python(mainly for win32) so that the ENTIRE install is
    > maybe less than 5MBs and includes possibly a GUI library, possibly
    > TwistedMatrix, possibly install from just unzipping an archive like
    > applications such as Eclipse.
    >
    > So, my question, has anybody done this similar to what I did? I can
    > show you how I did it, but it was so quick, I didnt really think about
    > what libraries I included.
    >
    > There are mini linuxes out there, I suggest mini pythons.
    >
    > Why? For example, I don't need an XML-RPC library, or zip library, or
    > the other libraries.
    >
    > http://newspiritcompany.com/blog/art...-2mb-for-win32
    >
    >[/color]


    Or, maybe this is so easy, it doesnt deserve even mentioning. I found
    it difficult and I still haven't tested it fully.

    --
    Ramza from Atlanta

    Comment

    • Steve M

      #3
      Re: Python Light Revisted?

      I agree with you in part and disagree in part.

      I don't see the point to making the distribution any smaller. 10MB for
      the installer from python.org, 16MB for ActiveState .exe installer. How
      is 5MB "lightweigh t" while 10MB isn't? The Windows XP version of Java
      at java.com is 16+ MB, and the .NET framework is, well, I don't know
      how big, but I doubt it's much less than 10MB.

      Also I think it's a terrible idea to distribute without pieces of the
      standard library if the distribution is meant to be developed against
      for arbitrary applications. (If you just want a slimmed down Python for
      one specific application, use py2exe - I think it only includes
      whatever gets imported for your program to run.) And excluding zip
      while including Twisted? I don't get it. Besides, how do you know
      Twisted doesn't import XML-RPC? I could see an enlarged Python that
      includes Twisted along with the standard library, and in fact
      ActiveState's includes win32 stuff. There's another such
      mega-distribution around, the name of which escapes me at the moment.
      But removing zip from the standard library so you can save 20kb seems
      foolish. (Again, unless it is for one specific application, in which
      case py2exe should do the trick, although I could be wrong about that
      since I've never used it.)

      Now, what I do agree with is a Python that can be run from a folder
      without having to be installed on the system. That could have lots of
      benefits, if the details with pythonpath and whatever could be sorted
      out. For example I haven't upgraded to 2.4 yet because I have 20
      different packages (e.g. SOAPpy, ZODB, whatever) installed on WinXP,
      many of which required me selecting my 2.3 installation when I
      installed them. I have no idea what will happen to all those if I run
      the ActiveState installer for 2.4. I seem even to remember reading that
      I have to un-install 2.3 before installing 2.4. I don't want to
      re-install those 20 packages. Anyway I haven't had time to research it
      and it isn't pressing, even though I'd like to start trying decorators
      and generator expressions.

      Comment

      • Ramza Brown

        #4
        Re: Python Light Revisted?

        Steve M wrote:[color=blue]
        > I agree with you in part and disagree in part.
        >
        > I don't see the point to making the distribution any smaller. 10MB for
        > the installer from python.org, 16MB for ActiveState .exe installer. How
        > is 5MB "lightweigh t" while 10MB isn't? The Windows XP version of Java
        > at java.com is 16+ MB, and the .NET framework is, well, I don't know
        > how big, but I doubt it's much less than 10MB.
        >
        > Also I think it's a terrible idea to distribute without pieces of the
        > standard library if the distribution is meant to be developed against
        > for arbitrary applications. (If you just want a slimmed down Python for
        > one specific application, use py2exe - I think it only includes
        > whatever gets imported for your program to run.) And excluding zip
        > while including Twisted? I don't get it. Besides, how do you know
        > Twisted doesn't import XML-RPC? I could see an enlarged Python that
        > includes Twisted along with the standard library, and in fact
        > ActiveState's includes win32 stuff. There's another such
        > mega-distribution around, the name of which escapes me at the moment.
        > But removing zip from the standard library so you can save 20kb seems
        > foolish. (Again, unless it is for one specific application, in which
        > case py2exe should do the trick, although I could be wrong about that
        > since I've never used it.)
        >
        > Now, what I do agree with is a Python that can be run from a folder
        > without having to be installed on the system. That could have lots of
        > benefits, if the details with pythonpath and whatever could be sorted
        > out. For example I haven't upgraded to 2.4 yet because I have 20
        > different packages (e.g. SOAPpy, ZODB, whatever) installed on WinXP,
        > many of which required me selecting my 2.3 installation when I
        > installed them. I have no idea what will happen to all those if I run
        > the ActiveState installer for 2.4. I seem even to remember reading that
        > I have to un-install 2.3 before installing 2.4. I don't want to
        > re-install those 20 packages. Anyway I haven't had time to research it
        > and it isn't pressing, even though I'd like to start trying decorators
        > and generator expressions.
        >[/color]

        I see your concern. But, I am talking about, for example I have 70MB in
        my Python directory. I don't remember what the download size was. I
        know that can be reduced. 5MB completely unzipped. Plus, If the python
        setup is light enough, have a complete environment away from the 'main'
        90MB environment, one that doesnt manipulate registry settings and whatnot.

        --
        Ramza from Atlanta

        Comment

        • Ramza Brown

          #5
          Re: Python Light Revisted?

          Steve M wrote:[color=blue]
          > I agree with you in part and disagree in part.
          >
          > I don't see the point to making the distribution any smaller. 10MB for
          > the installer from python.org, 16MB for ActiveState .exe installer. How
          > is 5MB "lightweigh t" while 10MB isn't? The Windows XP version of Java
          > at java.com is 16+ MB, and the .NET framework is, well, I don't know
          > how big, but I doubt it's much less than 10MB.
          >
          > Also I think it's a terrible idea to distribute without pieces of the
          > standard library if the distribution is meant to be developed against
          > for arbitrary applications. (If you just want a slimmed down Python for
          > one specific application, use py2exe - I think it only includes
          > whatever gets imported for your program to run.) And excluding zip
          > while including Twisted? I don't get it. Besides, how do you know
          > Twisted doesn't import XML-RPC? I could see an enlarged Python that
          > includes Twisted along with the standard library, and in fact
          > ActiveState's includes win32 stuff. There's another such
          > mega-distribution around, the name of which escapes me at the moment.
          > But removing zip from the standard library so you can save 20kb seems
          > foolish. (Again, unless it is for one specific application, in which
          > case py2exe should do the trick, although I could be wrong about that
          > since I've never used it.)
          >
          > Now, what I do agree with is a Python that can be run from a folder
          > without having to be installed on the system. That could have lots of
          > benefits, if the details with pythonpath and whatever could be sorted
          > out. For example I haven't upgraded to 2.4 yet because I have 20
          > different packages (e.g. SOAPpy, ZODB, whatever) installed on WinXP,
          > many of which required me selecting my 2.3 installation when I
          > installed them. I have no idea what will happen to all those if I run
          > the ActiveState installer for 2.4. I seem even to remember reading that
          > I have to un-install 2.3 before installing 2.4. I don't want to
          > re-install those 20 packages. Anyway I haven't had time to research it
          > and it isn't pressing, even though I'd like to start trying decorators
          > and generator expressions.
          >[/color]
          Also, py2exe will work '100%' without a host python install. I have
          never used it. I have my doubts though?

          --
          Ramza from Atlanta

          Comment

          • Max

            #6
            Re: Python Light Revisted?

            Steve M wrote:[color=blue]
            > I agree with you in part and disagree in part.
            >
            > I don't see the point to making the distribution any smaller. 10MB for
            > the installer from python.org, 16MB for ActiveState .exe installer. How
            > is 5MB "lightweigh t" while 10MB isn't? The Windows XP version of Java
            > at java.com is 16+ MB, and the .NET framework is, well, I don't know
            > how big, but I doubt it's much less than 10MB.
            >[/color]

            AFAIR, it's closer to 50MB.

            --Max

            Comment

            • Steve Holden

              #7
              Re: Python Light Revisted?

              Steve M wrote:[color=blue]
              > I agree with you in part and disagree in part.
              >
              > I don't see the point to making the distribution any smaller. 10MB for
              > the installer from python.org, 16MB for ActiveState .exe installer. How
              > is 5MB "lightweigh t" while 10MB isn't? The Windows XP version of Java
              > at java.com is 16+ MB, and the .NET framework is, well, I don't know
              > how big, but I doubt it's much less than 10MB.
              >[/color]
              I really don't think that it's worth trying to compress the standard
              distribution any further, given that it isn't really bloatware. I can
              see the point for embedded systems and the like, but for generic PC use
              there isn't really a problem.
              [color=blue]
              > Also I think it's a terrible idea to distribute without pieces of the
              > standard library if the distribution is meant to be developed against
              > for arbitrary applications. (If you just want a slimmed down Python for
              > one specific application, use py2exe - I think it only includes
              > whatever gets imported for your program to run.) And excluding zip
              > while including Twisted? I don't get it. Besides, how do you know
              > Twisted doesn't import XML-RPC? I could see an enlarged Python that
              > includes Twisted along with the standard library, and in fact
              > ActiveState's includes win32 stuff. There's another such
              > mega-distribution around, the name of which escapes me at the moment.
              > But removing zip from the standard library so you can save 20kb seems
              > foolish. (Again, unless it is for one specific application, in which
              > case py2exe should do the trick, although I could be wrong about that
              > since I've never used it.)
              >
              > Now, what I do agree with is a Python that can be run from a folder
              > without having to be installed on the system. That could have lots of
              > benefits, if the details with pythonpath and whatever could be sorted
              > out. For example I haven't upgraded to 2.4 yet because I have 20
              > different packages (e.g. SOAPpy, ZODB, whatever) installed on WinXP,
              > many of which required me selecting my 2.3 installation when I
              > installed them. I have no idea what will happen to all those if I run
              > the ActiveState installer for 2.4. I seem even to remember reading that
              > I have to un-install 2.3 before installing 2.4. I don't want to
              > re-install those 20 packages. Anyway I haven't had time to research it
              > and it isn't pressing, even though I'd like to start trying decorators
              > and generator expressions.
              >[/color]
              Someone recently produced a distribution capable of running from a CD
              and designed to make it easy to use Python on machines where it wasn't
              actually installed. That might be a useful starting point too, but I
              can't find the right incantation to get Google to bring it up.

              regards
              Steve
              --
              Steve Holden +44 150 684 7255 +1 800 494 3119
              Holden Web LLC http://www.holdenweb.com/

              Comment

              • skip@pobox.com

                #8
                Re: Python Light Revisted?


                Ramza> The goal, build python(mainly for win32) so that the ENTIRE
                Ramza> install is maybe less than 5MBs and includes possibly a GUI
                Ramza> library, possibly TwistedMatrix, possibly install from just
                Ramza> unzipping an archive like applications such as Eclipse.

                ...

                Ramza> Why? For example, I don't need an XML-RPC library, or zip
                Ramza> library, or the other libraries.

                Let's suppose I decided to take your bait and build a python-lite
                distribution (fyi, I'm not biting). How would I know what to remove and
                what to retain? Some choices would be simple. If I was targeting Win32 I
                could clearly leave out Mac- or Unix-Specific stuff. I could probably
                dispense with the docs on the premise that you could read them online. How
                would I decide whether to keep or toss xmlrpclib or zipfile? If I keep
                xmlrpclib should I also keep SimpleXMLRPCSer ver? What about unicodedata
                (it's a biggie)?

                What about compatibility? If someone installs the python-lite distro then
                downloads, let's say, Tailor, a version control converter. What are the
                chances that it will croak with an ImportError? Put another way, are you
                really willing to trade off a few megs of disk space against almost certain
                breakage at some point in the near future?

                I can understand that distributions for some platforms (PalmOS, OS/2, Amiga,
                Jython) might contain fewer modules simply because not everything has been
                ported to them, but given the cost of disk space today I don't understand
                why a distribution for a mainstream platform should be hobbled.

                Skip

                Comment

                • Bryan

                  #9
                  Re: Python Light Revisted?

                  [color=blue]
                  > Someone recently produced a distribution capable of running from a CD
                  > and designed to make it easy to use Python on machines where it wasn't
                  > actually installed. That might be a useful starting point too, but I
                  > can't find the right incantation to get Google to bring it up.
                  >
                  > regards
                  > Steve[/color]

                  steve,

                  are you thinking about moveable python?



                  bryan

                  Comment

                  • Steve Holden

                    #10
                    Re: Python Light Revisted?

                    Bryan wrote:[color=blue][color=green]
                    >>Someone recently produced a distribution capable of running from a CD
                    >>and designed to make it easy to use Python on machines where it wasn't
                    >>actually installed. That might be a useful starting point too, but I
                    >>can't find the right incantation to get Google to bring it up.
                    >>
                    >>regards
                    >> Steve[/color]
                    >
                    >
                    > steve,
                    >
                    > are you thinking about moveable python?
                    >
                    > http://www.voidspace.org.uk/python/movpy/
                    >[/color]
                    The very one, thanks.

                    regards
                    Steve
                    --
                    Steve Holden +44 150 684 7255 +1 800 494 3119
                    Holden Web LLC http://www.holdenweb.com/

                    Comment

                    • Tim Hoffman

                      #11
                      Re: Python Light Revisted?

                      Ramza Brown wrote:[color=blue]
                      > Steve M wrote:
                      >[/color]
                      [color=blue][color=green]
                      >>[/color]
                      > Also, py2exe will work '100%' without a host python install. I have
                      > never used it. I have my doubts though?
                      >[/color]

                      Yes it sure does. I have distributed at least 3 different standalone
                      python programs using py2exe and I can absolutely garuntee that the
                      people running them do not have a seperate python install.

                      T

                      Comment

                      • Robin Becker

                        #12
                        Re: Python Light Revisted?

                        Steve Holden wrote:[color=blue]
                        > Bryan wrote:
                        >[color=green][color=darkred]
                        >>>Someone recently produced a distribution capable of running from a CD
                        >>>and designed to make it easy to use Python on machines where it wasn't
                        >>>actually installed. That might be a useful starting point too, but I
                        >>>can't find the right incantation to get Google to bring it up.
                        >>>
                        >>>regards
                        >>> Steve[/color]
                        >>
                        >>
                        >>steve,
                        >>
                        >>are you thinking about moveable python?
                        >>
                        >>http://www.voidspace.org.uk/python/movpy/
                        >>[/color]
                        >
                        > The very one, thanks.
                        >
                        > regards
                        > Steve[/color]

                        I have just used the NSIS + py2exe magic detailed at
                        http://starship.python.net/crew/thel...FileExecutable to create
                        a single exe tkinter + twisted app.

                        The whole thing took about 3 days to build and deploy to testing of which about
                        one day was figuring out how the NSIS + py2exe stuff worked. I think the nsis
                        script needed a minor tweak to do exactly what we wanted.

                        --
                        Robin Becker

                        Comment

                        • Fuzzyman

                          #13
                          Re: Python Light Revisted?


                          Steve M wrote:[color=blue]
                          > I agree with you in part and disagree in part.
                          >[/color]
                          [snip..][color=blue]
                          >
                          > Now, what I do agree with is a Python that can be run from a folder
                          > without having to be installed on the system. That could have lots of
                          > benefits, if the details with pythonpath and whatever could be sorted
                          > out. For example I haven't upgraded to 2.4 yet because I have 20[/color]

                          You mean like Movable Python ? *grin* (Windoze only though I'm afraid)


                          [color=blue]
                          > different packages (e.g. SOAPpy, ZODB, whatever) installed on WinXP,
                          > many of which required me selecting my 2.3 installation when I
                          > installed them. I have no idea what will happen to all those if I run
                          > the ActiveState installer for 2.4. I seem even to remember reading that
                          > I have to un-install 2.3 before installing 2.4. I don't want to
                          > re-install those 20 packages. Anyway I haven't had time to research it
                          > and it isn't pressing, even though I'd like to start trying decorators
                          > and generator expressions.[/color]

                          I faced similar issues - in the end it wasn't such a pain though.



                          Just make a list of the modules you want to keep and fetch the Python
                          2.4 installers before making the switch. Gives you a nice opportunity
                          to clean up your 'site-packages' folder.

                          Regards,

                          Fuzzyman


                          Comment

                          • Berlin  Brown

                            #14
                            Re: Python Light Revisted?

                            "Let's suppose I decided to take your bait and build a python-lite
                            distribution (fyi, I'm not biting). "

                            Of course not, that is the point, everybody is always right. What I
                            want is the option to distribute something to light my users. I have
                            done with java, lisp and other languages. But. I can't figure out the
                            best approach for Python. And, with python being the only
                            implementation, that is another story?

                            I also don't want to use their messed up Python install that may or may
                            not work. It is the microsoft registry issue, meaning; I don't like
                            the concept of one source for screws up. If a user screws up their
                            Python install, and I submit an application to them and now my
                            application is screwed up, what can I do? Control is a good thing. I
                            was considering something light, mainly for the application only, user
                            clicks start and they are off.


                            "What about compatibility? If someone installs the python-lite distro
                            then
                            downloads, let's say, Tailor, a version control converter. What are
                            the
                            chances that it will croak with an ImportError? Put another way, are
                            you
                            really willing to trade off a few megs of disk space against almost
                            certain
                            breakage at some point in the near future?"

                            It wont get that complex. Python-lite is designed for each
                            application. It is lite so you won't lose that much diskspace.

                            "I can understand that distributions for some platforms (PalmOS, OS/2,
                            Amiga,
                            Jython) might contain fewer modules simply because not everything has
                            been
                            ported to them, but given the cost of disk space today I don't
                            understand
                            why a distribution for a mainstream platform should be hobbled. "

                            I use jython works great, because I can distribute the light version.
                            The only thing that has to work is java and I distribute the
                            interpreter to all of my apps as the jython.jar library.

                            Comment

                            Working...