trident-chemwidgets icon indicating copy to clipboard operation
trident-chemwidgets copied to clipboard

Cannot show structure in pip version

Open pikakolendo02 opened this issue 3 years ago • 12 comments

Hello, I use Arch Linux and I have installed JupyterLab from pip. I installed trident-chemwidgets tried the Scatter_widget.ipynb from examples but it cannot display structures. Hovering and click "Show Structures" displayed nothing. pip

I tried conda version with JupyterLab in conda and everything was OK. conda

This is a list of pip list output:

Package                        Version
------------------------------ -----------
anyio                          3.6.1
argon2-cffi                    21.3.0
argon2-cffi-bindings           21.2.0
asttokens                      2.0.8
attrs                          22.1.0
Babel                          2.10.3
backcall                       0.2.0
backports.functools-lru-cache  1.6.4
beautifulsoup4                 4.11.1
black                          22.6.0
bleach                         5.0.1
brotlipy                       0.7.0
certifi                        2022.6.15
cffi                           1.15.1
charset-normalizer             2.1.1
click                          8.1.3
colorama                       0.4.5
conda                          4.14.0
conda-package-handling         1.8.1
cryptography                   37.0.4
cycler                         0.11.0
debugpy                        1.6.3
decorator                      5.1.1
defusedxml                     0.7.1
entrypoints                    0.4
executing                      1.0.0
fastjsonschema                 2.16.1
flit_core                      3.7.1
fonttools                      4.37.1
greenlet                       1.1.3
idna                           3.3
importlib-metadata             4.11.4
importlib-resources            5.9.0
ipykernel                      6.15.2
ipython                        8.4.0
ipython-genutils               0.2.0
ipywidgets                     8.0.2
isort                          5.10.1
jedi                           0.18.1
Jinja2                         3.1.2
joblib                         1.1.0
json5                          0.9.10
jsonschema                     4.15.0
jupyter                        1.0.0
jupyter_client                 7.3.5
jupyter-console                6.4.4
jupyter-core                   4.11.1
jupyter-server                 1.18.1
jupyterlab                     3.4.6
jupyterlab-code-formatter      1.5.3
jupyterlab-language-pack-zh-CN 3.4.post4
jupyterlab-pygments            0.2.2
jupyterlab_server              2.15.1
jupyterlab-widgets             3.0.3
kiwisolver                     1.4.4
lxml                           4.9.1
MarkupSafe                     2.1.1
matplotlib                     3.5.3
matplotlib-inline              0.1.6
mistune                        2.0.4
munkres                        1.1.4
mypy-extensions                0.4.3
nbclassic                      0.4.3
nbclient                       0.6.7
nbconvert                      7.0.0
nbformat                       5.4.0
nest-asyncio                   1.5.5
notebook                       6.4.12
notebook-shim                  0.1.0
numpy                          1.23.2
packaging                      21.3
pandas                         1.4.4
pandas-datareader              0.10.0
pandocfilters                  1.5.0
parso                          0.8.3
pathspec                       0.10.1
pexpect                        4.8.0
pickleshare                    0.7.5
Pillow                         9.2.0
pip                            22.2.2
pkgutil_resolve_name           1.3.10
platformdirs                   2.5.2
ply                            3.11
Pmw                            2.0.1
prometheus-client              0.14.1
prompt-toolkit                 3.0.31
psutil                         5.9.2
ptyprocess                     0.7.0
pure-eval                      0.2.2
pycairo                        1.21.0
pycosat                        0.6.3
pycparser                      2.21
Pygments                       2.13.0
pymol                          2.5.0
pyOpenSSL                      22.0.0
pyparsing                      3.0.9
PyQt5                          5.15.7
PyQt5-sip                      12.11.0
pyrsistent                     0.18.1
PySocks                        1.7.1
python-dateutil                2.8.2
pytz                           2022.2.1
pyzmq                          23.2.1
qtconsole                      5.3.2
QtPy                           2.2.0
reportlab                      3.5.68
requests                       2.28.1
ruamel-yaml-conda              0.15.80
scikit-learn                   1.1.2
scipy                          1.9.1
Send2Trash                     1.8.0
setuptools                     65.3.0
sip                            6.6.2
six                            1.16.0
sniffio                        1.3.0
soupsieve                      2.3.2.post1
SQLAlchemy                     1.4.40
stack-data                     0.5.0
terminado                      0.15.0
threadpoolctl                  3.1.0
tinycss2                       1.1.1
toml                           0.10.2
tomli                          2.0.1
toolz                          0.12.0
tornado                        6.2
tqdm                           4.64.1
traitlets                      5.3.0
trident-chemwidgets            0.2.1
typing_extensions              4.3.0
unicodedata2                   14.0.0
urllib3                        1.26.11
wcwidth                        0.2.5
webencodings                   0.5.1
websocket-client               1.4.1
wheel                          0.37.1
widgetsnbextension             4.0.3
zipp                           3.8.1

Could it be a problem of missing package? Thank you.

pikakolendo02 avatar Sep 06 '22 06:09 pikakolendo02

Thanks for reporting this issue @pikakolendo02! I have a suspicion that this may be related to serving the RDKit JS assets to the front end. We have some custom filesystem manipulations we perform on install and something may be strange with the pip version/Arch Linux combination. We generally test the releases on Mac and Windows, but not Arch Linux. I'll see if I can replicate your issue on Mac first, then in Docker with Arch if I can't replicate it there. I'll let you know if I have a solution for you. If there's no easy fix, we'll make sure to have Linux compatibility in our next release. In the meantime, I'd recommend sticking with the conda version if that's working. Will update here once I've had a chance to test it.

TShimko126 avatar Sep 07 '22 16:09 TShimko126

We took a look at this bug again on Windows, MacOS, and Ubuntu and weren't able to replicate the issue: the pip installed version displayed the structures on all systems. Would it be possible for you to load the developer console and report any error messages there? Chrome and Firefox instructions here, respectively. Thanks in advance!

TShimko126 avatar Sep 12 '22 20:09 TShimko126

Thank you for reply @TShimko126 . pip ver: 图片 图片 (匿名) means anonymous. conda ver: 图片 图片

I hope these could help you.

pikakolendo02 avatar Sep 12 '22 21:09 pikakolendo02

Thanks for the screenshots, these are very helpful. I believe this is probably a permissions issue with our local assets provider. TCW needs write access to the Jupyter extension directories as well as some other files. I expect that this might not be possible if you're installing with pip globally. My thought is that conda is using a virtualenv directory with looser permissions to which TCW can write on setup.

Are you installing with pip globally or within a different vitualenv provider? Thanks!

@gilberto-md: We should add a warning if TCW doesn't have write permissions to the Jupyter target dirs on install.

TShimko126 avatar Sep 13 '22 16:09 TShimko126

These packages are installed locally in ~/.local/lib/python3.10/site-packages

pip list --user
Package                        Version
------------------------------ -----------
anyio                          3.6.1
argon2-cffi                    21.3.0
argon2-cffi-bindings           21.2.0
Babel                          2.10.3
beautifulsoup4                 4.11.1
bleach                         5.0.1
debugpy                        1.6.3
defusedxml                     0.7.1
entrypoints                    0.4
fastjsonschema                 2.16.1
ipykernel                      6.15.2
ipython-genutils               0.2.0
ipywidgets                     8.0.2
Jinja2                         3.1.2
json5                          0.9.10
jsonschema                     4.15.0
jupyter_client                 7.3.5
jupyter-core                   4.11.1
jupyter-server                 1.18.1
jupyterlab                     3.4.6
jupyterlab-code-formatter      1.5.3
jupyterlab-language-pack-zh-CN 3.4.post4
jupyterlab-pygments            0.2.2
jupyterlab_server              2.15.1
jupyterlab-widgets             3.0.3
MarkupSafe                     2.1.1
mistune                        2.0.4
nbclassic                      0.4.3
nbclient                       0.6.7
nbconvert                      7.0.0
nbformat                       5.4.0
nest-asyncio                   1.5.5
notebook                       6.4.12
notebook-shim                  0.1.0
pandocfilters                  1.5.0
prometheus-client              0.14.1
pyrsistent                     0.18.1
pyzmq                          23.2.1
rdkit                          2022.3.5
Send2Trash                     1.8.0
sniffio                        1.3.0
soupsieve                      2.3.2.post1
terminado                      0.15.0
tinycss2                       1.1.1
tornado                        6.2
trident-chemwidgets            0.2.1
webencodings                   0.5.1
websocket-client               1.4.1
widgetsnbextension             4.0.3

pikakolendo02 avatar Sep 13 '22 17:09 pikakolendo02

Hi, I am having the same issue. I did install to global pip on a virtual Linux machine. Everything works except structure drawing from selection or the tooltip in the scatter plot. Do you know if changing permissions somewhere would help here?

johnberroa avatar Mar 06 '23 12:03 johnberroa

I also just installed in a venv on a Mac, same issue. Pip is installing version 0.2.1. image

I'm using jupyter notebooks (not lab):

>> jupyter nbextension list                                                                                                                   
Known nbextensions:
  config dir: /Users/.../venv/etc/jupyter/nbconfig
    notebook section
      jupyterlab-plotly/extension  enabled 
      - Validating: OK
      trident_chemwidgets/extension  enabled 
      - Validating: OK
      jupyter-js-widgets/extension  enabled 
      - Validating: OK

johnberroa avatar Mar 06 '23 12:03 johnberroa

Thanks for uploading the package. I'm on an M1 mac and I still have the problem that no interactive features of the plots are basically happening. Any advices?

Many thanks

GattiMh avatar Apr 12 '23 15:04 GattiMh

Sorry for the delay here, we've been quite busy with some other projects so maintenance on the chemwidgets package has fallen a bit behind.

@johnberroa - Is it possible for you to try with the conda installation (conda install -c conda-forge trident-chemwidgets)? We seem to have better luck getting the rdkit.js assets to the right location/permissions with conda than with pip.

@GattiMh - I don't think any of the devs have an M1 mac to test the package on. Could you provide some more information regarding your browser (and if possible screenshot the console window in your browser as @johnberroa did in his message above)?

Thanks to both of you for reporting these issues. A fix will probably take a little bit since we are busy working on other tasks at the moment, but for now I'd recommend using the conda version when possible and seeing if that fixes your issues. If not, please let me know and we can bump this higher on the priority list.

TShimko126 avatar Apr 13 '23 18:04 TShimko126

Sorry for the delay here, we've been quite busy with some other projects so maintenance on the chemwidgets package has fallen a bit behind.

@johnberroa - Is it possible for you to try with the conda installation (conda install -c conda-forge trident-chemwidgets)? We seem to have better luck getting the rdkit.js assets to the right location/permissions with conda than with pip.

@GattiMh - I don't think any of the devs have an M1 mac to test the package on. Could you provide some more information regarding your browser (and if possible screenshot the console window in your browser as @johnberroa did in his message above)?

Thanks to both of you for reporting these issues. A fix will probably take a little bit since we are busy working on other tasks at the moment, but for now I'd recommend using the conda version when possible and seeing if that fixes your issues. If not, please let me know and we can bump this higher on the priority list.

Thanks! I have sorted the problem by doing conda/mamba install nodejs

I've also done brew install node and brew install npmbut maybe this is not important and the conda will be enough

Hope that helps the others as well.

Best wishes

GattiMh avatar Apr 28 '23 10:04 GattiMh

Same issue on Linux, can't solve it using conda install -c conda-forge trident-chemwidgets. Have you solved it? Any advice? Thanks! image

enzo547 avatar Jul 23 '23 02:07 enzo547

I have the same issue with pip installation on windows. what is going on?

clccer avatar Jan 29 '24 11:01 clccer