1
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

jupyter lab build を proxy 内環境で通す

Posted at

このメモの目的

  • パスワード付き proxy 環境下で jupyter lab build がエラーするのを解決する
  • OS: Windows10
  • python: miniconda でインストールした python 3,
  • miniconda でインストールした jupyter lab, nodejs 環境

Abstract

An error in jupyter lab build within a network inside a proxy wall was resolved after setting appropriate proxy setting in npmrc and .yarnrc. OS: Windows10,

解決策

  • npm と yarn の proxy 設定を行って、jupyter lab build が通るようになった

npm の proxy 設定

  • 使用環境の npmrc に proxy などを設定した
  • ファイルの所在地は C:\Users\natsuriver\AppData\Local\Continuum\miniconda3\envs\py37\etc\npmrc
https-proxy = "http://[userID]:[passwd]@proxy.of.your.domain:8000/"
proxy = "http://[userID]:[passwd]@proxy.of.your.domain:8000"
registry = "http://registry.npmjs.org/"
strict-ssl = false

yarn の proxy 設定

  • 使用環境の jupyterlab の下にある .yarnrc に proxy などを設定した
  • ファイルの所在地は C:\Users\natsuriver\AppData\Local\Continuum\miniconda3\envs\py37\Lib\site-packages\jupyterlab\staging.yarnrc
yarn-path "./yarn.js"
ignore-optional true
network-timeout "1000000"
yarn config set proxy http://[userID]:[passwd]@proxy.of.your.domain:8000 -g
yarn config set https-proxy http://[userID]:[passwd]@proxy.of.your.domain:8000 -g

結果

npm の proxy 環境設定と yarn の proxy を設定したところ、build できるようになった。

エラーの詳細

jupyter lab build コマンドがこんなエラーログファイルを出力して終了していた。

[LabBuildApp] Building in C:\Users\natsuriver\AppData\Local\Continuum\miniconda3\envs\py37\share\jupyter\lab
[LabBuildApp] Node v14.4.0

[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
[LabBuildApp] > node C:\Users\natsuriver\AppData\Local\Continuum\miniconda3\envs\py37\lib\site-packages\jupyterlab\staging\yarn.js install --non-interactive
[LabBuildApp] yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving 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 Couldn't find package "@jupyter-widgets/base@^2 || ^3" required by "jupyter-matplotlib@file:../extensions/jupyter-matplotlib-0.7.2.tgz" on the "npm" registry.
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\natsuriver\AppData\Local\Continuum\miniconda3\envs\py37\lib\site-packages\jupyterlab\debuglog.py", line 47, in debug_logging
    yield

[LabBuildApp]   File "C:\Users\natsuriver\AppData\Local\Continuum\miniconda3\envs\py37\lib\site-packages\jupyterlab\labapp.py", line 138, in start
    raise e

[LabBuildApp]   File "C:\Users\natsuriver\AppData\Local\Continuum\miniconda3\envs\py37\lib\site-packages\jupyterlab\labapp.py", line 135, in start
    command=command, app_options=app_options)

[LabBuildApp]   File "C:\Users\natsuriver\AppData\Local\Continuum\miniconda3\envs\py37\lib\site-packages\jupyterlab\commands.py", line 460, in build
    command=command, clean_staging=clean_staging)

[LabBuildApp]   File "C:\Users\natsuriver\AppData\Local\Continuum\miniconda3\envs\py37\lib\site-packages\jupyterlab\commands.py", line 652, in build
    raise RuntimeError(msg)

[LabBuildApp] RuntimeError: npm dependencies failed to install

[LabBuildApp] Exiting application: JupyterLab
1
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?