GMOD / jbrowse-jupyter-tutorial

A demo of using jupyter-jbrowse locally
0 stars 0 forks source link

"from jbrowse_jupyter import launch, create" does not work #1

Closed ihh closed 10 months ago

ihh commented 10 months ago

I'm following this tutorial; the following line does not work for me

from jbrowse_jupyter import launch, create

Error message:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[9], line 1
----> 1 from jbrowse_jupyter import launch, create
      3 ## basic hg38 linear genome view pre-loaded by selected genome='hg38'
      4 hg38 = create('LGV', genome='hg38')

ModuleNotFoundError: No module named 'jbrowse_jupyter'

Output of pip list:

Package                   Version
------------------------- ------------
absl-py                   1.4.0
aiohttp                   3.8.6
aiosignal                 1.3.1
annotated-types           0.6.0
ansi2html                 1.8.0
anyio                     4.1.0
appnope                   0.1.3
argon2-cffi               23.1.0
argon2-cffi-bindings      21.2.0
array-record              0.4.1
arrow                     1.3.0
asttokens                 2.4.1
astunparse                1.6.3
async-lru                 2.0.4
async-timeout             4.0.3
attrs                     23.1.0
Babel                     2.13.1
beautifulsoup4            4.12.2
bleach                    6.1.0
build                     1.0.3
cached-property           1.5.2
cachetools                5.3.1
certifi                   2023.7.22
cffi                      1.16.0
charset-normalizer        3.2.0
chex                      0.1.82
click                     8.1.7
click-default-group       1.2.4
comm                      0.2.0
dash                      2.14.2
dash-core-components      2.0.0
dash-html-components      2.0.0
dash-jbrowse              1.3.4
dash-table                5.0.0
dataclasses               0.6
debugpy                   1.8.0
decorator                 5.1.1
defusedxml                0.7.1
dm-haiku                  0.0.10
dm-tree                   0.1.8
einops                    0.6.1
etils                     1.4.1
executing                 2.0.1
fastjsonschema            2.19.0
filelock                  3.12.3
fire                      0.5.0
Flask                     2.1.3
flatbuffers               23.5.26
flax                      0.7.2
flaxmodels                0.1.3
fqdn                      1.5.1
frozenlist                1.4.0
fsspec                    2022.11.0
gast                      0.4.0
google-auth               2.22.0
google-auth-oauthlib      1.0.0
google-pasta              0.2.0
googleapis-common-protos  1.60.0
grpcio                    1.57.0
h5py                      3.9.0
idna                      3.4
importlib-metadata        7.0.0
importlib-resources       6.0.1
iniconfig                 2.0.0
ipykernel                 6.27.1
ipython                   8.18.1
isoduration               20.11.0
itsdangerous              2.1.2
jax                       0.4.14
jax-smi                   1.0.3
jaxlib                    0.4.14
jbrowse-jupyter           1.5.6
jedi                      0.19.1
Jinja2                    3.1.2
jmp                       0.0.4
joblib                    1.3.2
json5                     0.9.14
jsonargparse              4.27.0
jsonnet                   0.20.0
jsonpointer               2.4
jsonschema                4.20.0
jsonschema-specifications 2023.11.2
jupyter_client            8.6.0
jupyter_core              5.5.0
jupyter-events            0.9.0
jupyter-lsp               2.2.1
jupyter_server            2.11.2
jupyter_server_terminals  0.4.4
jupyterlab                4.0.9
jupyterlab_pygments       0.3.0
jupyterlab_server         2.25.2
keras                     2.13.1
libclang                  16.0.6
llm                       0.11
Markdown                  3.4.4
markdown-it-py            3.0.0
MarkupSafe                2.1.3
matplotlib-inline         0.1.6
mdurl                     0.1.2
mistune                   3.0.2
ml-dtypes                 0.2.0
more-itertools            10.1.0
msgpack                   1.0.5
multidict                 6.0.4
natsort                   8.4.0
nbclient                  0.9.0
nbconvert                 7.12.0
nbformat                  5.9.2
nest-asyncio              1.5.7
notebook_shim             0.2.3
numpy                     1.25.2
oauthlib                  3.2.2
objax                     1.7.0
openai                    0.28.1
opt-einsum                3.3.0
optax                     0.1.7
orbax-checkpoint          0.3.5
overrides                 7.4.0
packaging                 23.1
pandas                    2.1.4
pandocfilters             1.5.0
parameterized             0.9.0
parso                     0.8.3
pexpect                   4.9.0
Pillow                    10.0.0
pip                       23.3.1
pip-tools                 7.3.0
platformdirs              4.1.0
plotly                    5.18.0
pluggy                    1.3.0
prometheus-client         0.19.0
promise                   2.3
prompt-toolkit            3.0.41
protobuf                  3.20.3
psutil                    5.9.5
ptyprocess                0.7.0
pure-eval                 0.2.2
pyasn1                    0.5.0
pyasn1-modules            0.3.0
pycparser                 2.21
pydantic                  2.4.2
pydantic_core             2.10.1
Pygments                  2.16.1
pyproject_hooks           1.0.0
pytest                    7.4.2
python-dateutil           2.8.2
python-json-logger        2.0.7
python-ulid               2.2.0
pytz                      2023.3.post1
PyYAML                    6.0.1
pyzmq                     25.1.1
referencing               0.31.1
regex                     2023.8.8
requests                  2.31.0
requests-oauthlib         1.3.1
retrying                  1.3.4
rfc3339-validator         0.1.4
rfc3986-validator         0.1.1
rich                      13.5.2
rpds-py                   0.13.2
rsa                       4.9
safejax                   0.5.0
safetensors               0.2.8
scikit-learn              1.3.2
scipy                     1.11.2
Send2Trash                1.8.2
setuptools                65.5.0
six                       1.16.0
sniffio                   1.3.0
soupsieve                 2.5
sqlite-fts4               1.0.3
sqlite-migrate            0.1a2
sqlite-utils              3.35.1
stack-data                0.6.3
tabulate                  0.9.0
tenacity                  8.2.3
tensorboard               2.13.0
tensorboard-data-server   0.7.1
tensorflow                2.13.0
tensorflow-datasets       4.9.2
tensorflow-estimator      2.13.0
tensorflow-macos          2.13.0
tensorflow-metadata       1.14.0
tensorstore               0.1.41
termcolor                 2.3.0
terminado                 0.18.0
threadpoolctl             3.2.0
tinycss2                  1.2.1
toml                      0.10.2
toolz                     0.12.0
tornado                   6.4
tqdm                      4.66.1
traitlets                 5.14.0
types-python-dateutil     2.8.19.14
typing_extensions         4.8.0
tzdata                    2023.3
uri-template              1.3.0
urllib3                   1.26.16
wcwidth                   0.2.12
webcolors                 1.13
webencodings              0.5.1
websocket-client          1.7.0
Werkzeug                  2.0.3
wheel                     0.41.2
wrapt                     1.15.0
yarl                      1.9.2
zipp                      3.16.2

Isn't it a bit odd to have a hyphen in the package name? c.f. https://stackoverflow.com/questions/761519/is-it-ok-to-use-dashes-in-python-files-when-trying-to-import-them

cmdcolin commented 10 months ago

Hmm, I have pretty much the same pip list as you with the dash in the name in pip list, but we import it using the underscore and I do not encounter the ModuleNotFound error on my machine. I'm using Python 3.11.6. It might be that hyphen is a weird choice anyways so we could reconsider, but not sure why you run into this error cause it does work for me

cmdcolin commented 10 months ago

do you know if you have any thing that could sort of complicate the setup like conda or bioconda installed? or multiple python versions installed like homebrew and system python? some of the guides that I have read point to that as being a cause of generally mysterious ModuleNotFound errors

ihh commented 10 months ago

I do have conda on the machine, and conda list (from the notebook) does not include jbrowse-jupyter. However, I am not sure how to install JBrowse-Jupyter in a way that miniconda3 can see it. conda install jbrowse-jupyter does not work.

Usually when I'm in a conda environment and I install something with pip, it installs it, so I'm not sure what's going on here

conda info says no environment is currently activated (but perhaps it is just using the "base" environment)

I'm multitasking a bit here so I can't chase this very effectively

ihh commented 10 months ago

Python version is 3.11.4

cmdcolin commented 10 months ago

no worries. I'll try to brainstorm and maybe try out some different environments to double check. as far as i can tell, on my machine, starting with the blank virtual env works ok with the tutorial but could be some system things...

ihh commented 10 months ago

I swear 20% of my time on Python projects is consumed by this kind of issue. If you can think of anything let me know. In the meantime I will try digging into it myself when I get a chance (maybe one evening at NeurIPS next week...)

ihh commented 10 months ago

as so often seems to be the case, a reboot inexplicably fixed this. closing.