0
votes

I would like to create a Notebook in Azure Data Studio, using the Powershell kernel. To do this on my personal laptop, I did selected the Powershell kernel in ADS and followed the next few steps. From what I can tell, these steps first downloaded and installed Python, and then they downloaded and installed the Powershell-kernel (and possibly linked the two together?).

I would like to do this on my work laptop, but unfortunately Azure Data Studio is blocked from accessing the internet (the error was Installing Notebook dependencies failed with error: ETIMEDOUT.) I reckon I should be able to do all of this by downloading all the required files and then manually installing them... I have already downloaded and installed python-3.9.2, and I can now use this as an existing Python installation in ADS. The next step in ADS is Step 2:Install dependencies, and it's asking me to install two kernels: jupyter 1.0.0 and powershell-kernel 0.1.4. If I click next, it attempts to download them by the looks of it. This is what is displayed in the output window:

Notebook dependencies installation is in progress > "c:\Users\my_username\AppData\Local\Programs\Python\Python39\python.exe" -m pip install --user "jupyter>=1.0.0" "powershell-kernel>=0.1.4" stderr: WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002010615BD90>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/jupyter/ stderr:

If I go to pypi.org, I am able to download these kernels (jupyter-1.0.0.tar.gz and jupyter-powershell-0.1.4.tar.gz), but I am just not sure how to install them or make ADS aware of them. Has anyone had any joy trying to do this? I'm on Windows 10 by the way.

Thanks for any help!

1

1 Answers

0
votes

I have managed to answer my own question here, and I will document what I did to help anyone out in future who has the same problem. I want to make it clear that I am simply trying to be able to use the Powershell Kernel in Azure Data Studio on a machine that does not allow Azure Data Studio access to the internet. Everything below is a means to an end, and I don't fully understand it all if I am really honest.

*These steps require the internet

  1. Install Python (3.9.2 64-bit), ensuring you add python to PATH. I installed for all users too.

  2. Run the following from the command prompt:

     python -m pip install wheel
     python -m pip install pywinpty
    

When you install pywinpty, it will create a file called pywinpty-0.5.7-py3-none-any.whl, and it will tell you where this file is saved in the output. This is what it said on my screen:

Created wheel for pywinpty: filename=pywinpty-0.5.7-py3-none-any.whl size=10348 sha256=c45cdc7832a02aae8a6c96b7d2861185ffa2bb86d71b66eae7a32900d4696eee Stored in directory: c:\users\administrator\appdata\local\pip\cache\wheels\53\76\53\01b01d6a997218adc05f673cd87078b0f3d5fbbe5b9ed7103b

Make a copy of pywinpty-0.5.7-py3-none-any.whl and store it for later.

  1. Run the following from the command prompt:

     python -m pip download pip -d "c:\python_modules"
     python -m pip download setuptools -d "c:\python_modules"
     python -m pip download powershell-kernel -d "c:\python_modules"
     python -m pip download jupyter -d "c:\python_modules"
    

After this, you should have lots of files in c:\python_modules (I had 58). For some reason, I had problems with c:\python_modules\pywinpty-0.5.7.tar.gz when trying to install pywinpty (which is a dependency of the jupyter module), so we should delete c:\python_modules\pywinpty-0.5.7.tar.gz and replace it with pywinpty-0.5.7-py3-none-any.whl that we saved before. This is the reason why we had to install the wheel module, as when running <python -m pip install wheel> without the wheel module installed, it did not create any files (though it did install the module, but that needed the internet which is what we're trying to do without).

At this point, we don't need the internet any more. Next, go to our non-internet computer and follow these steps:

  1. Install Python (3.9.2 64-bit), ensuring you add python to PATH. I installed for all users too.

  2. Copy the c:\python_modules folder and contents to our non-internet computer.

  3. Run the following from the command prompt:

     python -m pip install pip --upgrade --no-index --find-links "c:\python_modules"
     python -m pip install setuptools --upgrade --no-index --find-links "c:\python_modules"
     python -m pip install powershell-kernel --no-index --find-links "c:\python_modules"
     python -m pip install jupyter --no-index --find-links "c:\python_modules"
    
  4. Open Azure Data Studio. Open a new Notebook and change the kernel to Powershell. Walk through the wizard to 1. configure the python runtime and 2. install the dependencies. When installing the dependencies, it should skip past everything, as we have previously manually installed everything already.

That should be it! As an aside, if you DO have internet access, the final step (step 4.) is the only thing you should have to do. Which goes to show how cool and useful the internet is.