Open xnaxe29 opened 1 year ago
Hello!
specviz.app
is not the way to do it anymore (where did you get that notebook?). Try specviz.show()
and let us know if it works or still the same error.Thank you.
p.s. Jdaviz support in stenv
is not guaranteed, as that env is mainly used for pipeline processing, not post-pipeline data analysis. I would actually recommend trying this in a new env altogether.
conda deactivate
conda create -n jdaviz python=3.11
conda activate jdaviz
pip install jdaviz --no-cache-dir --upgrade
Then start a notebook:
jupyter notebook
Then inside the notebook, run this:
from jdaviz import Specviz
specviz = Specviz()
specviz.show()
Do you see the app now?
Thanks for using Jdaviz, Adarsh!
To expand on @pllim's comment earlier on the first point, to launch from the command line, you can launch jdaviz by running jdaviz
rather than python
. For more information, take a look at https://jdaviz.readthedocs.io/en/latest/specviz/import_data.html#importing-data-through-the-command-line
Hello,
Thanks for your response. I got the notebook from the STScI youtube video -
https://www.youtube.com/watch?v=fQcI9lHVB2Y&list=PLTOSd8OgUP5p4pRLTiVFY0kIRSw04xDP6&index=9
I will try the suggested solutions.
Thanks Adarsh
Hello!
- You cannot run Jdaviz from Python interpreter. Hence the "unsupported shell" error.
- You are supposed to be able to run Jdaviz in notebook but calling
specviz.app
is not the way to do it anymore (where did you get that notebook?). Tryspecviz.show()
and let us know if it works or still the same error.Thank you.
-- Reply to this email directly or view it on GitHub: https://github.com/spacetelescope/jdaviz/issues/2299#issuecomment-1638394878 You are receiving this because you authored the thread.
Message ID: @.***>
Hi [pllim],
I am trying to follow the JWebbinar series. - https://www.youtube.com/watch?v=fQcI9lHVB2Y&list=PLTOSd8OgUP5p4pRLTiVFY0kIRSw04xDP6&index=9 https://github.com/spacetelescope/jwebbinar_prep/blob/webbinar2/jdat_session/Specviz_Webbinar_solutions.ipynb
p.s. Jdaviz support in stenv is not guaranteed, as that env is mainly used for pipeline processing, not post-pipeline data analysis. I would actually recommend trying this in a new env altogether.
conda deactivate conda create -n jdaviz python=3.11 conda activate jdaviz pip install jdaviz --no-cache-dir --upgrade Then start a notebook:
jupyter notebook Then inside the notebook, run this:
from jdaviz import Specviz specviz = Specviz() specviz.show() Do you see the app now?
Thanks. This solution works from within a jupyter notebook. PS: Both - 'specviz.show()' and 'specviz.app' seem to work. FYI.
Thanks for using Jdaviz, Adarsh!
To expand on @pllim's comment earlier on the first point, to launch from the command line, you can launch jdaviz by running
jdaviz
rather thanpython
. For more information, take a look at https://jdaviz.readthedocs.io/en/latest/specviz/import_data.html#importing-data-through-the-command-line
Hi [duytnguyendtn],
Thanks for the suggestion. I tried - 'jdaviz --layout=specviz galaxy_jwst.fits' from the command line and it outputs an error - usage: jdaviz [-h] [--instrument INSTRUMENT] [--browser BROWSER] [--theme {light,dark}] [--verbosity {debug,info,warning,error}] [--history-verbosity {debug,info,warning,error}] [--hotreload | --no-hotreload] [--version] {cubeviz,specviz,specviz2d,mosviz,imviz} [filepaths ...] jdaviz: error: argument layout: invalid choice: 'galaxy_jwst.fits' (choose from 'cubeviz', 'specviz', 'specviz2d', 'mosviz', 'imviz')
Same error when I try - "jdaviz --layout='specviz' galaxy_jwst.fits" or "jdaviz --layout=specviz galaxy_jwst.fits galaxy_jwst.fits"
Am I using the syntax incorrectly?
Hi @xnaxe29,
I believe I know the problem. Could you try jdaviz specviz galaxy_jwst.fits
? (do not use --layout=
).
I suspect you may be on our stable release, which is version 3.5. (which you can confirm by running pip freeze
and searching for your version of jdaviz
). The link I sent you is for our latest documentation which hasn't been released yet. Here is the appropriate documentation for our latest stable release: https://jdaviz.readthedocs.io/en/stable/specviz/import_data.html#importing-data-through-the-command-line
Once we update to version 3.6, the other command I sent you will be the correct syntax (including --layout=
)
Sorry about that confusion! Duy
Hi @xnaxe29,
I believe I know the problem. Could you try
jdaviz specviz galaxy_jwst.fits
? (do not use--layout=
).I suspect you may be on our stable release, which is version 3.5. (which you can confirm by running
pip freeze
and searching for your version ofjdaviz
). The link I sent you is for our latest documentation which hasn't been released yet. Here is the appropriate documentation for our latest stable release: https://jdaviz.readthedocs.io/en/stable/specviz/import_data.html#importing-data-through-the-command-lineOnce we update to version 3.6, the other command I sent you will be the correct syntax (including
--layout=
)Sorry about that confusion! Duy
Here is the new error after I run "jdaviz specviz galaxy_jwst.fits" -
Traceback (most recent call last):
File "/opt/homebrew/bin/jdaviz", line 8, in <module>
sys.exit(_main())
^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/jdaviz/cli.py", line 144, in _main
main(filepaths=args.filepaths, layout=layout, instrument=args.instrument, browser=args.browser,
File "/opt/homebrew/lib/python3.11/site-packages/jdaviz/cli.py", line 99, in main
sys.exit(Voila().launch_instance(argv=[]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/traitlets/config/application.py", line 1042, in launch_instance
app.initialize(argv)
File "/opt/homebrew/lib/python3.11/site-packages/voila/app.py", line 407, in initialize
self.setup_template_dirs()
File "/opt/homebrew/lib/python3.11/site-packages/voila/app.py", line 413, in setup_template_dirs
self.template_paths = collect_template_paths(['voila', 'nbconvert'], template_name, prune=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/voila/paths.py", line 24, in collect_template_paths
return collect_paths(app_names, template_name, include_root_paths=True, prune=prune, root_dirs=root_dirs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/voila/paths.py", line 90, in collect_paths
raise ValueError(
ValueError: No template sub-directory with name 'base' found in the following paths:
@xnaxe29 A template traceback is usually the sign of a broken installation. Could you detail how you installed Jdaviz?
I would try to reinstall jdaviz by running:
pip uninstall jdaviz
pip install jdaviz
and hopefully the templates will be copied to the right place.
I tried to run specviz from command line -
It gives the error -
Using jupyter notebook -
It outputs only this statement ->
But the application does not start.
Do you know what is wrong?
I am using a Macbook Pro M2 pro (13.4.1) with 'stenv' recommended conda environment. Python 3.9.16, jdaviz 3.5.0.
Please let me know if someone has faced this problem and knows how to solve this.
Thanks Adarsh