PYTHONDOCS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J. D. Leach

    #1

    PYTHONDOCS

    OK, I'm stupid. I have been unable to discern (even Googled) a way to set
    the PYTHONDOCS variable to point to where the HTML files are. What to do? I
    need to know the process and where theses variables are stored.
    --
    J. D. Leach
    Columbus, Indiana USA

    Linux/Open Source Computer using:
    Mandrakelinux release 10.2 (Limited Edition 2005) for i586 kernel
    2.6.11-6mdk

  • Fernando Perez

    #2
    Re: PYTHONDOCS

    J. D. Leach wrote:
    [color=blue]
    > OK, I'm stupid. I have been unable to discern (even Googled) a way to set
    > the PYTHONDOCS variable to point to where the HTML files are. What to do? I
    > need to know the process and where theses variables are stored.[/color]

    It's an environment variable. In my case:

    PYTHONDOCS=/usr/share/doc/python-docs-2.3.4/html

    You need to locate the proper dir on your system, and then use your shell's
    syntax for this (export/setenv for bash/tcsh).

    cheers,

    f

    Comment

    • Chris Smith

      #3
      Re: PYTHONDOCS

      >>>>> "J" == J D Leach <jdleach04@sbcg lobal.net> writes:

      J> OK, I'm stupid. I have been unable to discern (even Googled) a
      J> way to set the PYTHONDOCS variable to point to where the HTML
      J> files are. What to do? I need to know the process and where
      J> theses variables are stored. -- J. D. Leach Columbus, Indiana
      J> USA

      J> Linux/Open Source Computer using: Mandrakelinux release 10.2
      J> (Limited Edition 2005) for i586 kernel 2.6.11-6mdk

      J,
      I'm stupider; I can't ATFQ for you.
      But last night I stayed at a Holiday Inn Express, and can recommend

      Edgewall is a highly experienced team of software developers specializing in emerging internet and web technologies. We build professional, innovative and creative solutions for the web based on open source components, operating systems and frameworks.


      Which, assuming you've got connectivity, is teh shiznit.
      HTH,
      Chris

      Comment

      • Mike Meyer

        #4
        Re: PYTHONDOCS

        Chris Smith <smitty_one_eac h@bigfoot.com> writes:[color=blue][color=green][color=darkred]
        >>>>>> "J" == J D Leach <jdleach04@sbcg lobal.net> writes:[/color][/color]
        > I'm stupider; I can't ATFQ for you.
        > But last night I stayed at a Holiday Inn Express, and can recommend
        >
        > http://projects.edgewall.com/python-sidebar/
        >
        > Which, assuming you've got connectivity, is teh shiznit.[/color]

        Along the same lines, the OS X application launcher "Butler" comes
        pre-configured with a "search python reference materials"
        shortcut. I launch the shortcut, type in what I want,and hit enter,
        and a browser window opens displaying the results of the
        search. Adding other things - like searching the Python cookbook - is
        relatively easy.

        <mike
        --
        Mike Meyer <mwm@mired.or g> http://www.mired.org/home/mwm/
        Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

        Comment

        • J. D. Leach

          #5
          Re: PYTHONDOCS

          Mike Meyer wrote:
          [color=blue]
          > Chris Smith <smitty_one_eac h@bigfoot.com> writes:[color=green][color=darkred]
          >>>>>>> "J" == J D Leach <jdleach04@sbcg lobal.net> writes:[/color]
          >> I'm stupider; I can't ATFQ for you.
          >> But last night I stayed at a Holiday Inn Express, and can recommend
          >>
          >> http://projects.edgewall.com/python-sidebar/
          >>
          >> Which, assuming you've got connectivity, is teh shiznit.[/color]
          >
          > Along the same lines, the OS X application launcher "Butler" comes
          > pre-configured with a "search python reference materials"
          > shortcut. I launch the shortcut, type in what I want,and hit enter,
          > and a browser window opens displaying the results of the
          > search. Adding other things - like searching the Python cookbook - is
          > relatively easy.
          >
          > <mike[/color]

          Thanks Mike for the link. I installed the sidebar and have found it to be an
          invaluable aid in searching for info on Python. As for my problem with the
          PYTHONDOCS variable, I still get the message about not having the
          environment variable set. This is in spite of my setting the .bash profile
          correctly. As it stands, I am at a loss for how to fix the problem. Using
          the Mozilla sidebar, I found that the problem seems to involve several
          OS's. However, the fixes suggested were the ones I have already applied.
          Oh well, if I can't fix it, I'll just have to live with it.
          --
          J. D. Leach
          Columbus, Indiana USA

          Linux/Open Source Computer using:
          Mandrakelinux release 10.2 (Limited Edition 2005) for i586 kernel
          2.6.11-6mdk

          Comment

          • Dan Sommers

            #6
            Re: PYTHONDOCS

            On Mon, 02 Jan 2006 04:33:44 GMT,
            "J. D. Leach" <jdleach04@sbcg lobal.net> wrote:
            [color=blue]
            > ... This is in spite of my setting the .bash profile correctly. As it
            > stands, I am at a loss for how to fix the problem ...[/color]

            As a long shot, and I don't mean to insult anyone, but what is the name
            of your .bash profile, and are you sure it's executing? My bash man
            page mentions a lot of profile files, none of which is called ".bash";
            bash seems to have a mind of its own when it comes to deciding which
            profile files to read at which times; and it's not uncommon to set a
            variable and not export it, which means that echo works but nothing else
            does.

            Regards,
            Dan

            --
            Dan Sommers
            <http://www.tombstoneze ro.net/dan/>

            Comment

            • J. D. Leach

              #7
              Re: PYTHONDOCS

              Dan Sommers wrote:
              [color=blue]
              > As a long shot, and I don't mean to insult anyone, but what is the name
              > of your .bash profile, and are you sure it's executing? My bash man
              > page mentions a lot of profile files, none of which is called ".bash";
              > bash seems to have a mind of its own when it comes to deciding which
              > profile files to read at which times; and it's not uncommon to set a
              > variable and not export it, which means that echo works but nothing else
              > does.
              >
              > Regards,
              > Dan[/color]

              Not insulted at all Dan, I used to think I was quite proficient at all
              things digital in my youth, then age and numerous serious goofs and
              oversights on my part humbled me. The profile doc in question is
              named .bash_profile and now carries the following line:

              PYTHONDOCS=/usr/share/doc/python-2.4/html; export PYTHONDOCS

              To insure that my environment has indeed been altered, a quick command line
              entry using env shows this to be the case:

              ....some entries
              LANG=en_US
              PYTHONSTARTUP=/etc/pythonrc.py
              PYTHONDOCS=/usr/share/doc/python-2.4/html
              LESSOPEN=|/usr/bin/lesspipe.sh %s
              BROWSER=/usr/bin/www-browser
              ....more entries

              The above is in accordance with all written documentation I have been able
              to obtain, both within my local Python file directories, and those I've
              found online. However, neither of my Python installations (2.4
              in /usr/bin/, and 2.4.2 in /usr/local/bin/) recognize the existence of the
              html docs. The following error from within the Python shell yields the same
              result:

              Python 2.4.2 (#1, Dec 25 2005, 23:06:12)
              [GCC 3.4.3 (Mandrakelinux 10.2 3.4.3-7mdk)] on linux2
              Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
              >>> help('and')[/color][/color][/color]

              Sorry, topic and keyword documentation is not available because the Python
              HTML documentation files could not be found. If you have installed them,
              please set the environment variable PYTHONDOCS to indicate their location.
              [color=blue][color=green][color=darkred]
              >>>[/color][/color][/color]

              From the command line, if I enter:

              [jdleach@deepgra y ~]$ pydoc if


              The same error is raised. And this is where it gets really strange. If I
              load pydoc from within eric3 (python IDE I use), I receive:

              ....[color=blue][color=green][color=darkred]
              >>> pydoc - the Python documentation tool[/color][/color][/color]

              pydoc.py <name> ...
              Show text documentation on something. <name> may be the name of a...
              ....more info

              Then when I enter the os.environ.get( 'PYTHONDOCS') method, the following is
              produced:
              [color=blue][color=green][color=darkred]
              >>> os.environ.get( 'PYTHONDOCS')[/color][/color][/color]
              '/usr/share/doc/python-2.4/html'[color=blue][color=green][color=darkred]
              >>> help('if')[/color][/color][/color]

              ....Sorry, topic and keyword blah, blah, blah. No inline info
              available...bla h, blah, bite me dolt...

              I'm lost. Surely I've missed something simple.
              Thank you for your time and sorry about the long post. I just wanted to
              document in detail what is going on.

              J. D. Leach

              Comment

              • Peter Hansen

                #8
                Re: PYTHONDOCS

                J. D. Leach wrote:[color=blue]
                > I'm lost. Surely I've missed something simple.[/color]

                Maybe you can look in the source. "help" is an object defined by
                site.py to be a "Helper" object from pydoc.py. Look in your Python lib
                folder for pydoc.py and you should be able to trace through and find the
                source of the problem. You can probably insert some print statements,
                or maybe use "import pdb; pdb.set_trace" or some such approach.

                -Peter

                Comment

                • Peter Otten

                  #9
                  Re: PYTHONDOCS

                  J. D. Leach wrote:
                  [color=blue]
                  > found online. However, neither of my Python installations (2.4
                  > in /usr/bin/, and 2.4.2 in /usr/local/bin/) recognize the existence of the
                  > html docs. The following error from within the Python shell yields the
                  > same result:[/color]
                  [color=blue]
                  > Then when I enter the os.environ.get( 'PYTHONDOCS') method, the following
                  > is produced:
                  >[color=green][color=darkred]
                  >>>> os.environ.get( 'PYTHONDOCS')[/color][/color]
                  > '/usr/share/doc/python-2.4/html'[color=green][color=darkred]
                  >>>> help('if')[/color][/color]
                  >
                  > ...Sorry, topic and keyword blah, blah, blah. No inline info
                  > available...bla h, blah, bite me dolt...
                  >
                  > I'm lost. Surely I've missed something simple.
                  > Thank you for your time and sorry about the long post. I just wanted to
                  > document in detail what is going on.
                  >
                  > J. D. Leach[/color]

                  What do you get if you do
                  [color=blue][color=green][color=darkred]
                  >>> import pydoc
                  >>> pydoc.help.docd ir[/color][/color][/color]
                  '/should/be/path/to/docs'

                  I believe there is a bug in the documentation-finding code. With the current
                  logic PYTHONDOCS will only be honoured if none of the following directories
                  exist:

                  $PYTHONHOME/lib
                  (sys.executable )/doc/lib
                  /usr/doc/python-docs-2.4.2/lib
                  /usr/doc/python-2.4.2/lib
                  /usr/doc/python-docs-2.4/lib
                  /usr/doc/python-2.4/lib
                  (sys.prefix)/Resources/English.lproj/Documentation/lib

                  I think (untested) the proper fix would be an extra break

                  --- pydoc.py 2006-01-02 18:54:04.870404 232 +0100
                  +++ pydoc1.py 2006-01-02 18:54:30.440516 984 +0100
                  @@ -1635,6 +1635,7 @@
                  os.path.join(sy s.prefix,
                  'Resources/English.lproj/Documentation')]:
                  if dir and os.path.isdir(o s.path.join(dir , 'lib')):
                  self.docdir = dir
                  + break

                  def __repr__(self):
                  if inspect.stack()[1][3] == '?':

                  Consider filing a bug report.

                  Peter

                  Comment

                  • J. D. Leach

                    #10
                    Re: PYTHONDOCS

                    Peter Otten wrote:
                    [color=blue]
                    > What do you get if you do
                    >[color=green][color=darkred]
                    >>>> import pydoc
                    >>>> pydoc.help.docd ir[/color][/color]
                    > '/should/be/path/to/docs'[/color]

                    The response is:[color=blue][color=green][color=darkred]
                    >>>import pydoc
                    >>>print pydoc.help.docd ir[/color][/color][/color]
                    None[color=blue][color=green][color=darkred]
                    >>>[/color][/color][/color]

                    Obviously not there.
                    [color=blue]
                    >
                    > I believe there is a bug in the documentation-finding code. With the
                    > current logic PYTHONDOCS will only be honoured if none of the following
                    > directories exist:
                    >
                    > $PYTHONHOME/lib
                    > (sys.executable )/doc/lib
                    > /usr/doc/python-docs-2.4.2/lib
                    > /usr/doc/python-2.4.2/lib
                    > /usr/doc/python-docs-2.4/lib
                    > /usr/doc/python-2.4/lib
                    > (sys.prefix)/Resources/English.lproj/Documentation/lib
                    >
                    > I think (untested) the proper fix would be an extra break
                    >
                    > --- pydoc.py 2006-01-02 18:54:04.870404 232 +0100
                    > +++ pydoc1.py 2006-01-02 18:54:30.440516 984 +0100
                    > @@ -1635,6 +1635,7 @@
                    > os.path.join(sy s.prefix,
                    > 'Resources/English.lproj/Documentation')]:
                    > if dir and os.path.isdir(o s.path.join(dir , 'lib')):
                    > self.docdir = dir
                    > + break
                    >
                    > def __repr__(self):
                    > if inspect.stack()[1][3] == '?':
                    >
                    > Consider filing a bug report.
                    >
                    > Peter[/color]

                    I believe you are right, a bug report is probably warranted here.

                    --
                    J. D. Leach
                    Columbus, Indiana USA

                    Comment

                    • Peter Otten

                      #11
                      Re: PYTHONDOCS

                      J. D. Leach wrote:
                      [color=blue]
                      > The response is:[color=green][color=darkred]
                      >>>>import pydoc
                      >>>>print pydoc.help.docd ir[/color][/color]
                      > None[color=green][color=darkred]
                      >>>>[/color][/color]
                      >
                      > Obviously not there.[/color]

                      You are getting no match rather than the wrong one. Have you verified that a
                      subdirectory

                      /usr/share/doc/python-2.4/html/lib

                      exists on your system? If not, the documentation may not be properly
                      installed.

                      Peter

                      Comment

                      • J. D. Leach

                        #12
                        Re: PYTHONDOCS

                        Peter Otten wrote:
                        [color=blue]
                        >
                        > You are getting no match rather than the wrong one. Have you verified that
                        > a subdirectory
                        >
                        > /usr/share/doc/python-2.4/html/lib
                        >
                        > exists on your system? If not, the documentation may not be properly
                        > installed.
                        >
                        > Peter[/color]

                        I checked it Peter and rearranged the files in the python-2.4 directory
                        every which way absent deleting them, all to no avail. Interestingly, the
                        format and placement of the documentation was (before my modifications of
                        today) as originally installed when downloaded from python.org. I would
                        assume that they should have been in the correct order and directories when
                        initially installed.

                        --
                        J. D. Leach
                        Columbus, Indiana USA

                        Comment

                        • Mike Meyer

                          #13
                          Re: PYTHONDOCS

                          "J. D. Leach" <jdleach04@sbcg lobal.net> writes:[color=blue]
                          > Mike Meyer wrote:[color=green]
                          >> Chris Smith <smitty_one_eac h@bigfoot.com> writes:[color=darkred]
                          >>>>>>>> "J" == J D Leach <jdleach04@sbcg lobal.net> writes:
                          >>> I'm stupider; I can't ATFQ for you.
                          >>> But last night I stayed at a Holiday Inn Express, and can recommend
                          >>>
                          >>> http://projects.edgewall.com/python-sidebar/
                          >>>
                          >>> Which, assuming you've got connectivity, is teh shiznit.[/color]
                          >>
                          >> Along the same lines, the OS X application launcher "Butler" comes
                          >> pre-configured with a "search python reference materials"
                          >> shortcut. I launch the shortcut, type in what I want,and hit enter,
                          >> and a browser window opens displaying the results of the
                          >> search. Adding other things - like searching the Python cookbook - is
                          >> relatively easy.
                          >>
                          >> <mike[/color]
                          >
                          > Thanks Mike for the link.[/color]

                          To give credit where credit is due, Chris Smimth provided the link to
                          the sidebar. I didn't provide a link, but just mentioned a great
                          product that can be found at your favorite Mac software repository.

                          <mike
                          --
                          Mike Meyer <mwm@mired.or g> http://www.mired.org/home/mwm/
                          Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

                          Comment

                          • Florian Diesch

                            #14
                            Re: PYTHONDOCS

                            J. D. Leach <jdleach04@sbcg lobal.net> wrote:[color=blue]
                            > Peter Otten wrote:
                            >[color=green]
                            >>
                            >> You are getting no match rather than the wrong one. Have you verified that
                            >> a subdirectory
                            >>
                            >> /usr/share/doc/python-2.4/html/lib
                            >>
                            >> exists on your system? If not, the documentation may not be properly
                            >> installed.[/color]
                            >
                            > I checked it Peter and rearranged the files in the python-2.4 directory
                            > every which way absent deleting them, all to no avail. Interestingly, the[/color]

                            Do
                            strace -e trace=file -o /tmp/strace.log python -m pydoc 'if'
                            (or some other system call tracer that is available on your system)
                            and check /tmp/strace.log for where python is looking for the doc files.
                            Here it's /usr/share/doc/python2.4-doc/html/ref/if.html


                            Florian
                            --
                            Einen Troll zu füttern ist das gleiche als würde man einen Haufen
                            Hundescheisse sehen, absichtlich reinsteigen und sich dann beschweren.
                            (Christian Schneider in <2005-10-25T10-04-37@bofh.my-fqdn.de>)

                            Comment

                            Working...