Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panel examples ValueError could not find examples #4247

Closed
cdeil opened this issue Dec 31, 2022 · 4 comments
Closed

panel examples ValueError could not find examples #4247

cdeil opened this issue Dec 31, 2022 · 4 comments
Labels
type: bug Something isn't correct or isn't working type: docs Related to the Panel documentation and examples

Comments

@cdeil
Copy link
Contributor

cdeil commented Dec 31, 2022

I tried to follow the instructions at https://panel.holoviz.org/getting_started/installation.html

Error:

% panel examples --path ./

Traceback (most recent call last):
  File "/Users/cdeil/opt/anaconda3/envs/app/bin/panel", line 11, in <module>
    sys.exit(main())
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/panel/command/__init__.py", line 112, in main
    pyct.cmd.substitute_main('panel', cmds=pyct_commands, args=args)
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/pyct/cmd.py", line 455, in substitute_main
    args.func(args) if hasattr(args,'func') else parser.error("must supply command to run")
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/pyct/cmd.py", line 394, in <lambda>
    parser.set_defaults(func=lambda args: fn(name, **{k: getattr(args,k) for k in vars(args) if k!='func'} ))
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/pyct/cmd.py", line 38, in examples
    copy_examples(name, path, verbose, force)
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/pyct/cmd.py", line 44, in copy_examples
    source = _find_examples(name)
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/pyct/cmd.py", line 28, in _find_examples
    raise ValueError("Could not find examples for %s at any of %s"%(name,candidates))
ValueError: Could not find examples for panel at any of ['/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/panel/examples', '/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/panel/../examples']

This is with the latest stable version of panel:

% panel --version
0.14.1

Looking at the help the description of examples mentions fetch-data which doesn't seem to exist as a subcommand?

% panel --help
usage: panel [-h] [-v] {copy_examples,examples,build,info,init,json,sampledata,secret,serve,static,oauth-secret,convert} ...

positional arguments:
  {copy_examples,examples,build,info,init,json,sampledata,secret,serve,static,oauth-secret,convert}
                        Sub-commands
    copy_examples       Copy examples to the supplied path.
    examples            Copy examples and fetch data (if any) to the supplied path. See copy-examples and fetch-data for more flexibility. NOTE: force operates both on
                        example and data over-writing pre-existing files.
    build               Manage and build a bokeh extension
    info                Print information about Bokeh and Bokeh server configuration
    init                Initialize a bokeh extension
    json                Create JSON files for one or more applications
    sampledata          Download the bokeh sample data sets
    secret              Create a Bokeh secret key for use with Bokeh server
    serve               Run a Bokeh server hosting one or more applications
    static              Serve bokehjs' static assets (JavaScript, CSS, images, fonts, etc.)
    oauth-secret        Create a Panel encryption key for use with Panel server
    convert             Convert a Panel App to another format, e.g. a HTML file.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

See '<command> --help' to read about a specific subcommand.

The copy_examples description says "Copy examples to the supplied path" but then the command doesn't have an argument to supply a path!?

% panel copy_examples -h
usage: panel copy_examples [-h]

optional arguments:
  -h, --help  show this help message and exit

Executing copy_examples finishes without giving an error, but it doesn't seem to do anything (no terminal output or files in the current directory):

% panel copy_examples   
(app) cdeil@Christophs-MacBook-Pro panel % panel examples --path ./     

Traceback (most recent call last):
  File "/Users/cdeil/opt/anaconda3/envs/app/bin/panel", line 11, in <module>
    sys.exit(main())
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/panel/command/__init__.py", line 112, in main
    pyct.cmd.substitute_main('panel', cmds=pyct_commands, args=args)
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/pyct/cmd.py", line 455, in substitute_main
    args.func(args) if hasattr(args,'func') else parser.error("must supply command to run")
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/pyct/cmd.py", line 394, in <lambda>
    parser.set_defaults(func=lambda args: fn(name, **{k: getattr(args,k) for k in vars(args) if k!='func'} ))
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/pyct/cmd.py", line 38, in examples
    copy_examples(name, path, verbose, force)
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/pyct/cmd.py", line 44, in copy_examples
    source = _find_examples(name)
  File "/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/pyct/cmd.py", line 28, in _find_examples
    raise ValueError("Could not find examples for %s at any of %s"%(name,candidates))
ValueError: Could not find examples for panel at any of ['/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/panel/examples', '/Users/cdeil/opt/anaconda3/envs/app/lib/python3.9/site-packages/panel/../examples']

Am I doing it wrong? Or is it broken?

@CatChenal
Copy link

Same results with 0.14.2 (and python 3.9).

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Jan 12, 2023
@philippjfr philippjfr added this to the v0.14.3 milestone Jan 12, 2023
@philippjfr philippjfr modified the milestones: v0.14.3, next Feb 1, 2023
@robson-koji
Copy link

I am starting to try Panel, I run the copy examples of the following versions and it din't work: v0.14.2, v0.14.1 and v0.14.0

v0.13.0 seems to be working.

I would like to contribute to the project in the near future.

@otger
Copy link

otger commented Feb 17, 2023

Same here with panel==0.14.3 and python 3.10.9 on a mac

pip install on a new environment produces an empty examples folder at venv/lib/python3.10/site-packages/panel/examples

I've just cloned the repo and copied the examples folder to follow the tutorial

@philippjfr philippjfr removed this from the next milestone Mar 16, 2023
@philippjfr philippjfr added the type: docs Related to the Panel documentation and examples label Mar 16, 2023
@philippjfr
Copy link
Member

Appreciate the report, this was fixed in 0.14.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working type: docs Related to the Panel documentation and examples
Projects
None yet
Development

No branches or pull requests

5 participants