jupyter-renderers icon indicating copy to clipboard operation
jupyter-renderers copied to clipboard

Installation

Open realjumy opened this issue 6 years ago • 20 comments

I must say this problem was driving me crazy for a long time, until I finally managed to pinpoint the source of the problem.

To install jupyter-renders we need to use:

jupyter labextension install @jupyterlab/plotly-extension

In the README.md it states that is required Node.js >= 5. However, my installation always halted in the following line:

@jupyterlab/plotly-extension@file:../extensions/jupyterlab-plotly-extension-0.16.0.tgz

Well, after sweat, tears, and pulling half of the hairs from my beard, I discover that the solution was using Node 6. Using Linuxbrew (and I presume that Brew under OSX is the same) is just a matter of unlinking Node, installing Node@6, and linking Node@6. Once installed you can return to any other Node version unlinking Node@6 and relinking the original one.

I hope this helps to other users with the same problem.

realjumy avatar May 08 '18 18:05 realjumy

Sorry to hear this! Should we make any changes to the documentation?

gnestor avatar May 09 '18 20:05 gnestor

Well, I can definitely tell you that it doesn't work with Node 10.

I don't remember from the top of my head how to do it, but it's something like:

brew unlink node
brew install node@6 --force
brew link node@6 --force

And then install the extension.

If I knew this issue earlier I would have saved a lot of pain. Maybe yes, a change in the documentation would be great. Also, maybe someone with a bit of free time could test different Node versions.

EDIT:

This is the code:

brew unlink node
brew install node@6 --force
brew link --overwrite node@6 --force

At this point you should close the terminal or reboot the system before continuing.

jupyter labextension install @jupyterlab/plotly-extension

And now for restoring the original version of Node:

brew unlink node@6
brew link node

Again, closing the terminal or rebooting the system will be needed for preventing further problems.

With the code above, Node 6 is used for installing the extension, but the last version is restored once the process is completed.

I hope it helps.

realjumy avatar May 09 '18 21:05 realjumy

Thanks for the info @realjumy 👍

I just tested installing @jupyterlab/plotly-extension with Node 10 and I had no issues... I use n to manage Node versions, so I'm not sure what it's doing different than homebrew, but I would recommend using it as it's dead-simple to work with and it doesn't seem to be causing issues. Nonetheless, you need to install Node initially in order to npm install n, so I think many people in the Python community using conda: conda install -c conda-forge nodejs .

gnestor avatar May 11 '18 15:05 gnestor

In that case then the problem is caused by LinuxBrew. I have tried in 3 different computers, all with Linux Mint, and later with Ubuntu, and I always had issues. I will have to try with the alternative you're suggesting.

realjumy avatar May 11 '18 19:05 realjumy

I am seeing this after all using Node 10. It seems to be an issue with yarn on Node 10. Downgrading to Node 9 resolved it for me.

gnestor avatar May 11 '18 19:05 gnestor

Downgraded to Node 6 following the Brew method above and was able to successfully install the extension. Thanks @realjumy!!!

dvandagriff avatar May 12 '18 18:05 dvandagriff

This is what the community is for. I'm glad you managed to make it run ;)

@gnestor I used Node 6 because at the moment of writing this, Linuxbrew was failing to install Node 9. But good to know that Node 9 can be used too :D

realjumy avatar May 13 '18 10:05 realjumy

I'm unable to install this with Node 8.9 and Anaconda on Windows. (The permissions error occurs even after a restart).

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\User
s\\amellnik\\AppData\\Local\\Continuum\\Anaconda3\\share\\jupyter\\lab\\extensions\\temp'

amellnik avatar May 16 '18 14:05 amellnik

@amellnik I have seen this error before but don't remember details. What command did you run to produce this?

gnestor avatar May 17 '18 15:05 gnestor

@gnestor jupyter labextension install @jupyterlab/plotly-extension. The full error is:

Traceback (most recent call last):
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\Scripts\jupyter-labextension-script.py", line 5, in <module>
    sys.exit(jupyterlab.labextensions.main())
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyter_core\application.py", line 267, in
 launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\traitlets\config\application.py", line 658
, in launch_instance
    app.start()
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyterlab\labextensions.py", line 167, in
 start
    super(LabExtensionApp, self).start()
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyter_core\application.py", line 256, in
 start
    self.subapp.start()
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyterlab\labextensions.py", line 57, in
start
    for arg in self.extra_args]
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyterlab\labextensions.py", line 57, in
<listcomp>
    for arg in self.extra_args]
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 135, in inst
all_extension
    shutil.rmtree(target)
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\shutil.py", line 494, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\shutil.py", line 393, in _rmtree_unsafe
    onerror(os.rmdir, path, sys.exc_info())
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\shutil.py", line 391, in _rmtree_unsafe
    os.rmdir(path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\User
s\\amellnik\\AppData\\Local\\Continuum\\Anaconda3\\share\\jupyter\\lab\\extensions\\temp'

amellnik avatar May 17 '18 16:05 amellnik

Here's a similar issue: https://github.com/jupyterlab/jupyter-renderers/issues/127

Can you try stopping the jupyter server? Try running jupyter lab build?

gnestor avatar May 18 '18 00:05 gnestor

Any plans to fix this?

malmaud avatar Jun 25 '18 16:06 malmaud

@gnestor Sorry for the delay -- I missed the notification for your comment. I'm also not able to build lab now, and get an error related to the plotly extension:

> @jupyterlab/[email protected] build C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\share\jupyter\lab\staging
> webpack

Hash: 7ccff53d337f23fc5550
Version: webpack 2.7.0
Time: 33410ms

*** Webpack successfully emits a bunch of stuff here ***

ERROR in ./~/@jupyterlab/plotly-extension/lib/index.js
Module not found: Error: Can't resolve 'raw-loader' in 'C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\share\jupyte
r\lab\staging\node_modules\@jupyterlab\plotly-extension\lib'
 @ ./~/@jupyterlab/plotly-extension/lib/index.js 30:22-72
 @ ./build/index.out.js
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @jupyterlab/[email protected] build: `webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @jupyterlab/[email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\amellnik\AppData\Roaming\npm-cache\_logs\2018-06-25T18_38_36_143Z-debug.log

Traceback (most recent call last):
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\Scripts\jupyter-lab-script.py", line 5, in <module>
    sys.exit(jupyterlab.labapp.main())
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyter_core\application.py", line 267, in
 launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\traitlets\config\application.py", line 658
, in launch_instance
    app.start()
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1362, in st
art
    super(NotebookApp, self).start()
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyter_core\application.py", line 256, in
 start
    self.subapp.start()
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyterlab\labapp.py", line 44, in start
    build(self.app_dir, self.name, self.version)
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 514, in buil
d
    run([npm, 'run', 'build'], cwd=staging, logger=logger)
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 71, in run
    raise error
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 67, in run
    return check_output(cmd, **kwargs)
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['npm.cmd', 'run', 'build']' returned non-zero exit status 2.

amellnik avatar Jun 25 '18 18:06 amellnik

Which version of Anaconda are you using? Recently I was having lots of problems with a clean installation of Anaconda3-5.2.0, which was making me unable to use Jupyter Lab. After trying clean installations a couple of times, I decided to install an older version (Anaconda3-5.1.0) and everything was absolutely fine.

realjumy avatar Jun 26 '18 08:06 realjumy

The Module not found: Error: Can't resolve 'raw-loader' in 'C:\Users\amellnik\AppData\Local\Continuum\Anaconda3\share\jupyte r\lab\staging\node_modules\@jupyterlab\plotly-extension\lib' line suggests that the raw-loader module is not installed in the jupyterlab application directory which it should be. This is not affecting everyone so it's probably an environment issue. You can try force reinstalling jupyterlab. If that doiesn't help, try @realjumy's solution and downgrade or reinstall Anaconda.

gnestor avatar Jun 27 '18 00:06 gnestor

I'm also seeing this bug. Would be nice to get it fixed since the current node version on conda is 10.x, so many people will get it. Downgrading to node 6 is not really a practical solution.

The other solution, suggested at https://github.com/jupyter-widgets/ipywidgets/issues/2061#issuecomment-397117346, is to manually install yarn and configure jupyter lab to use that. Works for me, but still not the most friendly approach for beginners.

tiagopereira avatar Jul 19 '18 14:07 tiagopereira

Thanks for your suggestion @tiagopereira 👍 JupyterLab upgraded to yarn 1.7 and then ran into a bug and downgraded back to 1.6 because of a bug. I started the conversation back up at https://github.com/jupyterlab/jupyterlab/issues/4793.

gnestor avatar Jul 19 '18 18:07 gnestor

Downgrading to node 6 is not really a practical solution.

Conda-forge packages node 9, which works well with jlab.

jasongrout avatar Jul 19 '18 19:07 jasongrout

I'm unable to install this with Node 8.9 and Anaconda on Windows. (The permissions error occurs even after a restart).

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\User
s\\amellnik\\AppData\\Local\\Continuum\\Anaconda3\\share\\jupyter\\lab\\extensions\\temp'

I was able to resolve the same issue on Windows by downloading node 6 and replacing it in the path. Node 9 didn't work for me, but 6 did. You can get node 6 here: https://nodejs.org/download/release/v6.14.4/node-v6.14.4-win-x64.zip Extract it somewhere and put it in your path before your currently installed version, then try the install command. If you use a command line, try this to ensure it ends up in your path before your installed version:

C:\> set PATH=C:\nodejs6;%PATH%

(assuming of course that you extracted the zip file's nested folder to C:\nodejs6)

darkniobe avatar Sep 13 '18 18:09 darkniobe

Hi, I faced the same issue. I followed the instruction of @darkniobe, I went a step further but I now have the following issue :

Node v6.14.4

> C:\node-v6.14.4-win-x64\npm.CMD pack @jupyterlab/plotly-extension
npm WARN deprecated @jupyterlab/[email protected]: This package is being deprecated. Please use the Plotly-supported jupyterlab-plotly (https://www.npmjs.com/package/jupyterlab-plotly). See the plotly.py README for more info: https://github.com/plotly/plotly.py#jupyterlab-support-python-35
jupyterlab-plotly-extension-1.0.0.tgz

Node v6.14.4

Building jupyterlab assets
> node C:\anaconda\lib\site-packages\jupyterlab\staging\yarn.js install --non-interactive
yarn install v1.15.2
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=8". Got "6.14.4"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

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

  File "C:\anaconda\lib\site-packages\jupyterlab\debuglog.py", line 47, in debug_logging
    yield

  File "C:\anaconda\lib\site-packages\jupyterlab\labextensions.py", line 86, in start
    logger=self.log, command=command)

  File "C:\anaconda\lib\site-packages\jupyterlab\commands.py", line 373, in build
    command=command, clean_staging=clean_staging)

  File "C:\anaconda\lib\site-packages\jupyterlab\commands.py", line 557, in build
    raise RuntimeError(msg)

RuntimeError: npm dependencies failed to install

Exiting application: jupyter

Do you have any idea ?

Thanks in advance

antvig avatar Sep 30 '19 09:09 antvig