nglviewer / nglview

Jupyter widget to interactively view molecular structures and trajectories
http://nglviewer.org/nglview/latest/
Other
821 stars 134 forks source link

I am getting this issue whenever I try to install the nglview extension in jupterlab #983

Closed AK6263 closed 3 years ago

AK6263 commented 3 years ago

I used the following command and got this issue. I have attached the log file as well.

image

The Log File

Node v12.4.0

Yarn configuration loaded.
> /home/abhay/miniconda3/bin/npm pack nglview-js-widgets
npm notice 
npm notice package: nglview-js-widgets@3.0.1
npm notice === Tarball Contents === 
npm notice 1.2kB   LICENSE                                  
npm notice 2.5kB   lib/base.js                              
npm notice 4.8kB   lib/color.js                             
npm notice 25.4kB  lib/lib/colorpicker.min.js               
npm notice 5.8kB   src/lib/colorpicker.min.js               
npm notice 912B    lib/embed.js                             
npm notice 455B    src/embed.js                             
npm notice 1.1kB   lib/extension.js                         
npm notice 537B    src/extension.js                         
npm notice 3.9kB   lib/fullscreen.js                        
npm notice 156.9kB lib/gui.js                               
npm notice 61.4kB  src/gui.js                               
npm notice 4.2MB   dist/index.js                            
npm notice 1.5kB   lib/index.js                             
npm notice 21B     style/index.js                           
npm notice 1.2kB   lib/jupyterlab-plugin.js                 
npm notice 411B    src/jupyterlab-plugin.js                 
npm notice 11.7kB  lib/lib/signals.min.js                   
npm notice 3.2kB   src/lib/signals.min.js                   
npm notice 3.6kB   lib/theme.js                             
npm notice 65.9kB  lib/ui/ui.extra.js                       
npm notice 23.8kB  src/ui/ui.extra.js                       
npm notice 61.4kB  lib/ui/ui.js                             
npm notice 21.6kB  src/ui/ui.js                             
npm notice 22.6kB  lib/ui/ui.ngl.js                         
npm notice 8.0kB   src/ui/ui.ngl.js                         
npm notice 98.9kB  lib/widget_ngl.js                        
npm notice 3.0kB   package.json                             
npm notice 5.1MB   dist/index.js.map                        
npm notice 1.9kB   README.md                                
npm notice 3.8kB   dist/0de3b51742ed3ac61435875bccd8973b.png
npm notice 3.8kB   dist/208a290102a4ada58a04de354a1354d7.png
npm notice 3.8kB   dist/73a1fd052c9d84c0ee0bea3ee85892ed.png
npm notice 3.8kB   dist/971364734f3b603e5d363a2634898b42.png
npm notice 3.8kB   dist/a4c733ec4baef9ad3896d4e34a8a5448.png
npm notice 3.8kB   dist/bf27228a7d3957983584fa7698121ea1.png
npm notice 894B    src/base.ts                              
npm notice 2.0kB   src/color.ts                             
npm notice 1.6kB   src/fullscreen.ts                        
npm notice 555B    src/index.ts                             
npm notice 1.5kB   src/theme.ts                             
npm notice 42.6kB  src/widget_ngl.ts                        
npm notice === Tarball Details === 
npm notice name:          nglview-js-widgets                      
npm notice version:       3.0.1                                   
npm notice filename:      nglview-js-widgets-3.0.1.tgz            
npm notice package size:  1.9 MB                                  
npm notice unpacked size: 9.9 MB                                  
npm notice shasum:        9eb7a429bbd299b39708b6d878ee0c710ccfc2bf
npm notice integrity:     sha512-W+Z49CJNbqMWY[...]qIPe77dHuafGQ==
npm notice total files:   42                                      
npm notice 
nglview-js-widgets-3.0.1.tgz

Node v12.4.0

Yarn configuration loaded.
Building jupyterlab assets (production, minimized)
> node /home/abhay/miniconda3/lib/python3.8/site-packages/jupyterlab/staging/yarn.js install --non-interactive
yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.97s.

> node /home/abhay/miniconda3/lib/python3.8/site-packages/jupyterlab/staging/yarn.js yarn-deduplicate -s fewer --fail
yarn run v1.21.1
$ /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/.bin/yarn-deduplicate -s fewer --fail
Done in 1.71s.

> node /home/abhay/miniconda3/lib/python3.8/site-packages/jupyterlab/staging/yarn.js run build:prod:minimize
yarn run v1.21.1
$ webpack --config webpack.prod.minimize.config.js
[webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve './base.css' in '/home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/nglview-js-widgets/style'
    at /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/Compilation.js:1765:28
    at /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:730:13
    at eval (eval at create (/home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
    at /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:273:22
    at eval (eval at create (/home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:402:22
    at /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:117:11
    at /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:646:24
    at /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:800:8
    at /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:920:5
resolve './base.css' in '/home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/nglview-js-widgets/style'
  using description file: /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/nglview-js-widgets/package.json (relative path: ./style)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/nglview-js-widgets/package.json (relative path: ./style/base.css)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/nglview-js-widgets/style/base.css doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/nglview-js-widgets/style/base.css.js doesn't exist
      .json
        Field 'browser' doesn't contain a valid alias configuration
        /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/nglview-js-widgets/style/base.css.json doesn't exist
      .wasm
        Field 'browser' doesn't contain a valid alias configuration
        /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/nglview-js-widgets/style/base.css.wasm doesn't exist
      as directory
        /home/abhay/miniconda3/share/jupyter/lab/staging/node_modules/nglview-js-widgets/style/base.css doesn't exist
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

JupyterLab failed to build
Traceback (most recent call last):

  File "/home/abhay/miniconda3/lib/python3.8/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

  File "/home/abhay/miniconda3/lib/python3.8/site-packages/jupyterlab/labextensions.py", line 133, in start
    build(clean_staging=self.should_clean,

  File "/home/abhay/miniconda3/lib/python3.8/site-packages/jupyterlab/commands.py", line 469, in build
    return handler.build(name=name, version=version, static_url=static_url,

  File "/home/abhay/miniconda3/lib/python3.8/site-packages/jupyterlab/commands.py", line 678, in build
    raise RuntimeError(msg)

RuntimeError: JupyterLab failed to build

Exiting application: lab
hainm commented 3 years ago

hi @AK6263: You don't need that step anymore. nglview >= 3.0 should work out of the box in lab. Cheers.

https://github.com/nglviewer/nglview#released-version

szcc commented 2 years ago

I have nglview 3.0.3 and under nglview-js-widgets/style/ only has index.js. Same error. no base.js log: [webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve './base.css' in '/opt/conda/envs/mybio/share/jupyter/lab/staging/node_modules/nglview-js-widgets/style'

hainm commented 2 years ago

I have nglview 3.0.3 and under nglview-js-widgets/style/ only has index.js. Same error. no base.js log: [webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve './base.css' in '/opt/conda/envs/mybio/share/jupyter/lab/staging/node_modules/nglview-js-widgets/style'

You don't need to build the lab extension by yourself anymore. pip install nglview should be sufficient (or conda install ...)

szcc commented 2 years ago

Thank you for the quick responding. I tried

  1. pip install nglview
    and the our put is:Successfully installed ipywidgets-7.7.1 jupyterlab-widgets-1.1.1 nglview-3.0.3 widgetsnbextension-3.6.1
  2. jupyter-nbextension enable nglview --py --sys-prefix The out put: `Enabling notebook extension nglview-js-widgets/extension...
    • Validating: OK`
hainm commented 2 years ago

hi @szcc Can you please check and delete if you have those folders in your machines?

$HOME/.local/share/jupyter/nbextensions/nglview-js-widgets/, if Yes, delete it.

If you're using macos, might need to delete the folder $HOME/Library/Jupyter/nbextensions/nglview-js-widgets/
szcc commented 2 years ago

I found there are two nglview-js-widgets

find: ‘/etc/ssl/private’: Permission denied /opt/conda/share/jupyter/nbextensions/nglview-js-widgets /opt/conda/share/jupyter/labextensions/nglview-js-widgets find: ‘/proc/tty/driver’: Permission denied find: ‘/root’: Permission denied find: ‘/var/cache/apt/archives/partial’: Permission denied find: ‘/var/cache/ldconfig’: Permission denied

I removed nbextensions/nglview-js-widgets and reran the code and still did not get the image... only NGLWidget()

On Thu, Jun 30, 2022 at 12:05 PM Hai Nguyen @.***> wrote:

hi @szcc https://github.com/szcc Can you please check and delete if you have those folders in your machines?

$HOME/.local/share/jupyter/nbextensions/nglview-js-widgets/, if Yes, delete it.

If you're using macos, might need to delete the folder $HOME/Library/Jupyter/nbextensions/nglview-js-widgets/

— Reply to this email directly, view it on GitHub https://github.com/nglviewer/nglview/issues/983#issuecomment-1171404263, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLFBA7F7G54FWENW424JFLVRXAUHANCNFSM46E6QTDA . You are receiving this because you were mentioned.Message ID: <nglviewer/nglview/issues/983/1171404263 @.***>

hainm commented 2 years ago

hi @szcc Can you please check and delete if you have those folders in your machines?

$HOME/.local/share/jupyter/nbextensions/nglview-js-widgets/, if Yes, delete it.

If you're using macos, might need to delete the folder $HOME/Library/Jupyter/nbextensions/nglview-js-widgets/

@szcc I really mean about above paths. Please double check them. I don't mean to delete the paths you posted. After you check (and delete if existing) the paths I sent, please uninstall nglview and reinstall it (since you deleted the wrong paths).

szcc commented 2 years ago

Thanks for being patient with me. I did not see nglview under local/share ls -la $HOME/.local/share/jupyter/

[image: image.png] Also I uninstalled nglview and reinstalled it : [image: image.png] still no image...

On Thu, Jun 30, 2022 at 1:31 PM Hai Nguyen @.***> wrote:

hi @szcc https://github.com/szcc Can you please check and delete if you have those folders in your machines?

$HOME/.local/share/jupyter/nbextensions/nglview-js-widgets/, if Yes, delete it.

If you're using macos, might need to delete the folder $HOME/Library/Jupyter/nbextensions/nglview-js-widgets/

@szcc https://github.com/szcc I really mean about above paths. Please double check them. I don't mean to delete the paths you posted. After you check (and delete if existing) the paths I sent, please uninstall nglview and reinstall it (since you deleted the wrong paths).

— Reply to this email directly, view it on GitHub https://github.com/nglviewer/nglview/issues/983#issuecomment-1171494028, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLFBA2HC7CQCNLMRBGLQTDVRXKW5ANCNFSM46E6QTDA . You are receiving this because you were mentioned.Message ID: @.***>

hainm commented 2 years ago

um, while in your notebook, can you please open the browser console to read the error message

image -> Then click "Console" tab

And please post your screenshot of of the notebook.

szcc commented 2 years ago

[image: image.png]

On Thu, Jun 30, 2022 at 2:02 PM Hai Nguyen @.***> wrote:

um, while in your notebook, can you please open the browser console to read the error message

[image: image] https://user-images.githubusercontent.com/4451957/176746131-c07a3b60-7c48-4e10-8d2c-625ca586560c.png -> Then click "Console" tab

And please post your screenshot of of the notebook.

— Reply to this email directly, view it on GitHub https://github.com/nglviewer/nglview/issues/983#issuecomment-1171520269, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLFBA2BJTFRLIVF655AKELVRXOJVANCNFSM46E6QTDA . You are receiving this because you were mentioned.Message ID: @.***>

szcc commented 2 years ago

After I refresh the notebook. It works. Thanks a lot.

On Thu, Jun 30, 2022 at 2:13 PM Sue Nolte @.***> wrote:

[image: image.png]

On Thu, Jun 30, 2022 at 2:02 PM Hai Nguyen @.***> wrote:

um, while in your notebook, can you please open the browser console to read the error message

[image: image] https://user-images.githubusercontent.com/4451957/176746131-c07a3b60-7c48-4e10-8d2c-625ca586560c.png -> Then click "Console" tab

And please post your screenshot of of the notebook.

— Reply to this email directly, view it on GitHub https://github.com/nglviewer/nglview/issues/983#issuecomment-1171520269, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLFBA2BJTFRLIVF655AKELVRXOJVANCNFSM46E6QTDA . You are receiving this because you were mentioned.Message ID: @.***>

hainm commented 2 years ago

After I refresh the notebook. It works. Thanks a lot.

Great. Cheers

PS: By the way, attaching the image via email won't work. I don't see any of your images.

szcc commented 2 years ago

Maybe github stripped the images???

On Thu, Jun 30, 2022 at 2:29 PM Hai Nguyen @.***> wrote:

After I refresh the notebook. It works. Thanks a lot.

Great. Cheers

PS: By the way, attaching the image via email won't work. I don't see any of your images.

— Reply to this email directly, view it on GitHub https://github.com/nglviewer/nglview/issues/983#issuecomment-1171543742, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLFBAZBRQHVERCTJ3CHPODVRXRSNANCNFSM46E6QTDA . You are receiving this because you were mentioned.Message ID: @.***>