Plugin Development - Error: No such command 'plugin:new'

Hello,
I am starting at Octoprint plugins development and I am doing the tutorial available on their docs page.
I am currently unable to pass the first steps of setting up local development environment.
I have done all the step 4 times. One by one. All of them from the tutorial. Those are the steps:
First preparing the machine and setting up

sudo apt-get install python3 python3-pip python3-dev python3-setuptools python3-virtualenv git libyaml-dev build-essential

then:

cd ~/devel
git clone https://github.com/OctoPrint/OctoPrint.git
cd OctoPrint
virtualenv --python=python3 venv
source ./venv/bin/activate
pip install --upgrade pip
pip install -e '.[develop,plugins,docs]'
pre-commit install
git config blame.ignoreRevsFile .git-blame-ignore-revs

After this i go to the Developing Plugins tab:

$ cd ~/devel
$ git clone https://github.com/OctoPrint/OctoPrint
[...]
$ cd OctoPrint
$ virtualenv venv
[...]
$ source venv/bin/activate
(venv) $ pip install -e '.[develop,plugins]'
[...]
(venv) $ octoprint --help
Usage: octoprint [OPTIONS] COMMAND [ARGS]...

[...]

Then I go to the building the skeleton steps

I install this:

(venv) $ pip install "cookiecutter>=2.1.1,<3"

Then I give the command for creating the folders and stuff:

(venv) $ octoprint dev plugin:new helloworld

Then this keeps happening all the times and I cant figure it out:

Usage: octoprint dev [OPTIONS] COMMAND [ARGS]...
Try 'octoprint dev --help' for help.

Error: No such command 'plugin:new'.

On the website they say that this might happen and to be sure the cookiecutter is in the same python environment as OctoPrint.
So i checked it and yes, they are in the same environment:

This is the Octoprint folder and the virtual environment folder venv there
and the cookiecutter is this path:
/home/pi/OctoPrint/venv/lib/python3.12/site-packages/cookiecutter

That is what appears when I use $ octoprint dev --help:

Usage: octoprint dev [OPTIONS] COMMAND [ARGS]...

  Additional commands for development tasks.

Options:
  --help  Show this message and exit.

Commands:
  css:build
  plugin:install    Installs the local plugin in development mode.
  plugin:uninstall  Uninstalls the plugin with the given name.

I have set up a completely new virtual machine with Ubuntu. The only thing on the machine is what i downloaded in any of the cmd commands above. Python and git up do date.

I hope someone is able to help me and I appreciate!

As mentioned in Discord, I'm seeing the same issue and this appears to possibly be a bug.

sad. Do you know any other way to create de skeleton files?

In docs/plugins/gettingstarted.rst, there's a footnote that says that describes calling "cookiecutter gh:OctoPrint/cookiecutter-octoprint-plugin" by hand. That worked for me just now.

Yeah, that's what we worked out in Discord.

1 Like

There has been a fix applied for this in upcoming version 1.10.2.

1 Like

Until that is out, an easy solution is to downgrade cookie cutter:

pip install cookiecutter==2.5.0
1 Like