11

I'm new to using Anaconda and recently installed jupyter labs on my computer. However, any time I try to build on my local Jupyter Labs instance I get the following error:

Code run in jupyter labs terminal:

PS C:\Users\briakeit> jupyter lab build

Output:

[LabBuildApp] JupyterLab 1.2.5
[LabBuildApp] Building in C:\Users\briakeit\AnacondaFiles\share\jupyter\lab
[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: npm dependencies failed to install
See the log file for details:  C:\Users\briakeit\AppData\Local\Temp\jupyterlab-debug-0b5ejkfm.log

Log file:

[LabBuildApp] Building in C:\Users\briakeit\AnacondaFiles\share\jupyter\lab
[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Node v13.7.0

[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
[LabBuildApp] > node C:\Users\briakeit\AnacondaFiles\lib\site-packages\jupyterlab\staging\yarn.js install --non-interactive
[LabBuildApp] yarn install v1.15.2
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/@jupyterlab/application-extension/-/application-extension-1.2.1.tgz: read ECONNRESET".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\briakeit\\AnacondaFiles\\share\\jupyter\\lab\\staging\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

[LabBuildApp] npm dependencies failed to install
[LabBuildApp] Traceback (most recent call last):

[LabBuildApp]   File "C:\Users\briakeit\AnacondaFiles\lib\site-packages\jupyterlab\debuglog.py", line 47, in debug_logging
    yield

[LabBuildApp]   File "C:\Users\briakeit\AnacondaFiles\lib\site-packages\jupyterlab\labapp.py", line 98, in start
    command=command, app_options=app_options)

[LabBuildApp]   File "C:\Users\briakeit\AnacondaFiles\lib\site-packages\jupyterlab\commands.py", line 459, in build
    command=command, clean_staging=clean_staging)

[LabBuildApp]   File "C:\Users\briakeit\AnacondaFiles\lib\site-packages\jupyterlab\commands.py", line 660, in build
    raise RuntimeError(msg)

[LabBuildApp] RuntimeError: npm dependencies failed to install

[LabBuildApp] Exiting application: JupyterLab

This happens anytime I try using this command (e.g. after installing anew extension). I have npm v6.4.1, nodejs v10.13.0, and yarn v1.22.0 installed in this environment according to conda. I'm running Jupyter lab 1.2.6.

Any feedback, suggestions or help would be greatly appreciated.

Brian Keith
  • 255
  • 1
  • 3
  • 13

7 Answers7

4

I believe I have found the problem. I consult for a company and I was using the computer they provided me (I'm an admin on the computer). When I followed the same steps on my personal computer, it worked with no issues.

I then switched over to a different, more open network at work and the build was able to complete without errors. Clearly there is something in the firewall or something that was preventing me from doing the build.

Brian Keith
  • 255
  • 1
  • 3
  • 13
  • This is it! Also encountered the same on my working laptop. It turns out that when I'm not connected with a proxy to the firms network an app in the background breaks all `SSL` - connections. – Martin Bosch Oct 10 '20 at 13:06
2

Not sure if you've fixed it, if not you may try the solutions below.

info There appears to be trouble with your network connection. Retrying...

This is a yarn related error that seems to suggest something wrong with your network. This can happen if the yarn was trying to connect via a proxy. You can try the following if this is the case.

npm config rm proxy
npm config rm https-proxy

It can also happen if your network is too slow. You can try increasing Yarn timeout.

yarn add <yourPackage> --network-timeout 100000

Source: https://github.com/yarnpkg/yarn/issues/4890

AzyCrw4282
  • 7,222
  • 5
  • 19
  • 35
  • I installed yarn manually using conda with `conda install -c conda-forge/label/gcc7 yarn` Then I set the network timeout using: `yarn install --network-timeout 100000` I tried running the build in jupyter labs again and got basically the same log file so that unfortunately did not solve the issue. – Brian Keith Feb 18 '20 at 19:33
  • Ok. The issue seems like its arising from the extension that you've mentioned above. Can you describe more about it? That may just be the problem... – AzyCrw4282 Feb 18 '20 at 19:56
  • You mean the `conda install -c conda-forge/label/gcc7 yarn`? I got it from https://anaconda.org/conda-forge/yarn I'm not sure what exactly is in the package – Brian Keith Feb 18 '20 at 20:04
  • Hmmm. I am referring to where you mentioned in your question 'This happens anytime I try using this command (e.g. after installing anew extension). ' Is the extension you are talking about is it this `conda install -c conda-forge/label/gcc7 yarn`? – AzyCrw4282 Feb 18 '20 at 20:15
  • Oh my apologies. No I’m doing that through the Anaconda Prompt. It happens with any extension from GITHub. I think it’s a core issue though because I can’t even run ‘Jupyter lab build’ in the labs terminal. Specifically, I tried installing this extension: https://github.com/telamonian/theme-darcula – Brian Keith Feb 18 '20 at 20:26
  • So I am thinking that the problem is caused by the extensions. You can try uninstall and install jupter labs again this would definitely work. Alternatively, if you are looking to use a dark theme then I would recommend using the online jupyter lab from [here](https://jupyter.org/try). You can then install DarkReader extension for the browser which would them simply make the notebook theme darker. – AzyCrw4282 Feb 18 '20 at 20:44
  • Thank you for the response. I will try uninstalling and reinstalling jupyter labs. I tried creating a fresh environment with no packages installed, then installing nodejs only but still had the same issue. I’m not sure why the extensions would be causing the issue in that case since it’s empty and can’t even do a rebuild. – Brian Keith Feb 18 '20 at 20:47
  • 1
    You were right initially, it was a network issue, but the issue was with a firewall or something on the main network at my work. – Brian Keith Feb 19 '20 at 12:21
2

As indicated above this might be due to the fact that your company forces you to download everything over the proxy. Yarn (which is used to install npm) does not know your proxy details by default, so you need to create a .yarnrc file in your home directory (usually C:\Users\Username where you need to fill in your own username in windows, or simply ~/ on ubuntu).

In that file you need to specify your proxy settings as follows:

https-proxy "http://username:password@proxy.address.com:port"
strict-ssl false

Note no = sign in there and quotes around the address.

Then you'll be able to download the packages through your proxy.

Thomas
  • 1,823
  • 1
  • 8
  • 24
1

I faced similar issues and here are the solutions that works for me:

  1. Installed latest version of nodejs and npm.

  2. Manually installed latest version of yarn (download its msi installer instead of via cmd--> npm install --global yarn)

  3. remove npm proxy via cmd:

    npm config rm proxy

    npm config rm https-proxy

  4. Restarting the laptop

  5. jupyter lab build --dev-build=False --minimize=False

  6. Voila, it works flawlessly.

pizofreude
  • 11
  • 4
0

I had the same issue. I have tried different versions of nodejs with different environments but couldn't solve the issue. I have checked the log files and found out that there was a problem with yarn cache so clearing the yarn cache solved my problem.

0

From the logs you can see:

info There appears to be trouble with your network connection. Retrying...

I had the same issue, and disabling the firewall temporarily helped me to sort out part of the the issue, but then I finally got it with:

jupyter lab build --dev-build=False --minimize=False
nferreira78
  • 1,013
  • 4
  • 17
0

I had a similar issue associated with Norton notification blocking jupyter.exe and some other programs while running 'jupyter lab build'. I resolved this issue by 'Turn off or turn on Data Protector' in Norton or disabling Auto-protect and smart-firewall each time running 'jupyter lab build'.

Trung Nguyen
  • 37
  • 1
  • 6