anaconda / anaconda-project

Tool for encapsulating, running, and reproducing data science projects
https://anaconda-project.readthedocs.io/en/latest/
Other
219 stars 88 forks source link

Bad config encountered during initialization #289

Closed tejas-sme closed 3 years ago

tejas-sme commented 3 years ago

I am getting error when I run anaconda-project run default --NotbookApp.default_url=/apps/timezones.ipynb

Bad config encountered during initialization: Error loading argument NotbookApp.default_url['/notebooks/timezones.ipynb', '/apps/timezones.ipynb'], default_url only accepts one value, got 2: ['/notebooks/timezones.ipynb', '/apps/timezones.ipynb']

I need to set the default_url to /apps/timezones.ipynb so that notebook opens in appmode. If I don't set, then it opens in notebook mode. These are the versions I am using: anaconda-project: 0.8.3 notebook: 6.1.4 appmode: 0.8.0

AlbertDeFusco commented 3 years ago

It looks like the problem is that default_url is set automatically when you create a notebook command.

https://github.com/Anaconda-Platform/anaconda-project/blob/3804895ffcea4f2a88747b245fb493a1c0d777bc/anaconda_project/project_commands.py#L163

I was able to get the behavior you want with the following anaconda-project.yml file. Note that I'm not adding timezones.ipynb as an argument since the default_url will make sure launch that notebook.

name: timezones

packages:
  - python=3.7
  - notebook
  - appmode

channels:
  - defaults
  - conda-forge

commands:
  default:
    unix: jupyter notebook --NotebookApp.default_url=/apps/timezones.ipynb
tejas-sme commented 3 years ago

It opens up in appmode, however, I see this message:

Potential issues with this project:
- anaconda-project.yml: No command runs notebook timezones.ipynb

Old Config:

commands:
    default:
        notebook: timezones.ipynb
        env_spec: default

New Config:

commands:
    default:
        unix : jupyter notebook --NotebookApp.default_url=/apps/timezones.ipynb
        env_spec: default
AlbertDeFusco commented 3 years ago

Don't worry about the warning. We really should remove that.

tejas-sme commented 3 years ago

Thanks for helping.