1

I'm tryin' to find a way to install a python package with its docs. I have to use this on machines that have no connection to the internet and so online help is not a solution to me. Similar questions already posted here are telling that this is not possible. Do you see any way to make this easier as I'm currently doing this:

  1. downloading the source archive
  2. extracting the docs folder
  3. running sphinx
  4. launching the index file from a browser (firefox et al.)

Any ideas?

P.S. I'm very new to Python, so may be I'm missing something... And I'm using Windows (virtual) machines...

Edit:

I'm talking about two possible ways to install a package:

  1. installing the package via easy_install (or any other to me unknown way) on a machine while I'm online, and then copying the changes to my installation to the target machine
  2. downloading the source package (containing sphinx compatible docs) and installing the package on the target machine off-line

But in any case I do not know a way to install the package in a way that the supplied documentations are installed alltogether with module!

You might know that there exists a folder for the docs: <python-folder>/Doc which will contain only python278.chm after installation of Python 2.78 on Windows. So, I expect that this folder will also contain the docs for a newly installed package. This will avoid looking at docs for a different package version on the internet as well as my specific machine setup problems.

Most packages I'm currently using are supplied with documentation generated with sphinx, and their source package contains all the files necessary to generate the docs offline.

So what I'm looking for is some cli argument for a package installer like it's common for unix/linux based package managers. I did expect something like: easy_install a_package --with-html-docs.

rogepa
  • 43
  • 5

1 Answers1

1

Here are some scenarios:

  1. packages have documentation included within the zip/tar
  2. packages have a -docs to download/install seperately
  3. packages that have buildable documentation
  4. packages that only have online documentation
  5. packages with no documentation other than internal.
  6. packages with no documentation anywhere.

The sneaky trick that you can use for options 1 & 3 is to download the package as a tar or zip and then use easy-install archive_name on the target machine this will install the package from the zip or tar file including (I believe) any documentation. You will find that there are dependencies that are unmet in some packages - those should give an error on the easy install mentioning what is missing - you will need to get those and use the same trick.

A couple of things that are very handy - virtual-env will let you have a library free version of python running so you can get the requirements and pip -d <dir> which will download without installing storing your packages in dir.

You should be able to use the same trick for option 2.

With packages that only have on-line documentation you could look to see if there is a downloadable version or could scrape the web pages and use a tool like pandoc to convert to something useful.

In the 5 scenario I would suggest raising a ticket on the package stating that lack of accessible documentation makes it virtually unusable and running sphinx on it.

In scenario 6 I suggest raising the ticket but missing out virtually and avoiding the use of that package on the basis that if it has no documentation it probably has a lot of other problems as well - if you are a package author feeling slandered reading this then you should be feeling ashamed instead.

Mirror/Cache PyPi

Another possibly is to have a linux box, or VM, initially outside of your firewall, running a cached or mirroring service e.g. pipyserver, install the required packages through it to populate the cache and then move it, (or its cache to another pip server), inside the firewall and you can then use pip with the documented settings to do all your installs inside the firewall. See also the answer here.

Community
  • 1
  • 1
Steve Barnes
  • 27,618
  • 6
  • 63
  • 73
  • @ Steve: Thank you for clearify my question, but that is what I'm currently doing. The Problem is I want to do this automatically with the `--upgrade` option and I begin to realize that this is not possible. I thought there exists another better installer like *easy_install*. – rogepa Dec 22 '14 at 14:55
  • @rogepa An option that will support --upgrade added in Mirror/Cache PyPi – Steve Barnes Dec 22 '14 at 18:22