plotly / Kaleido

Fast static image export for web-based visualization libraries with zero dependencies
Other
349 stars 33 forks source link

Air gapped network installation? #108

Closed AustinRedding closed 2 years ago

AustinRedding commented 2 years ago

I'm using the Plotly library at work, but I want the ability to create static images programmatically by using Kaleido. However, the machine I'm working on is air-gapped and cannot touch the internet (I have the Anaconda installed, which is how I already have Plotly installed).

Is there an easy guide/ instructions for installing Kaleido without using pip or conda to install off internet channels? I.e. Is it possible to install the Kaleido package via a zip file? I've struggled to find much information for this manner of trying to install Kaleido (although, I understand that I am in the minority).

So far, I tried the following:

  1. Download Zip from https://github.com/plotly/Kaleido.git (Machine WITH internet access)
  2. Copy and transfer Zip over to machine WITHOUT internet access
  3. Extract Zip file content into \path\to\Kaleido
  4. Open 'Anaconda Prompt' and cd to \path\to\Kaleido
  5. cd to \repos\kaleido\py
  6. Run 'python setup.py install'

I've tried something similar with other python packages I've downloaded and running the setup.py script seems to work, but this hasn't been the case with Kaleido. I'm sure I'm just missing something completely, but when I try the steps I described above, I get the following error in the 'Anaconda Prompt.' Looking at the error message, I do see that there is no '_version.py' present in the directory that the setup.py script seems to be looking in. Is this intentional? Am I running the wrong thing?

`Anaconda Prompt output

Running setup.py during source installation
Traceback (most recent call last):    
File "setup.py", line 26, in < module >
    with open(os.path.join(here, 'kaleido', '_version.py'), 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Austin\\Desktop\\Kaleido-0.2.1.post1\\Kaleido-0.2.1.post1\\repos\\kaleido\\py\\kaleido\\_version.py'`

Any help or guidance would be greatly appreciated!

jonmmease commented 2 years ago

Hi @AustinRedding ,

The easiest thing is probably to download the kaleido wheel, for your architecture, from the GitHub releases page: https://github.com/plotly/Kaleido/releases/tag/v0.2.1

If you're on windows 64-bit, you would want the kaleido-0.2.1-py2.py3-none-win_amd64.whl file. Download this, and then you should be able to pip install kaleido-0.2.1-py2.py3-none-win_amd64.whl from an offline machine and have what you need, since the wheel doesn't have any external dependencies.

There are also kaleido-core and kaleido-python packages available on conda-forge. But these do have dependencies on a few other conda-forge packages, so it would be a little more involved to download everything you need that way.

Hope that helps!

AustinRedding commented 2 years ago

This worked beautifully! Thank you so much for the help.