sanic icon indicating copy to clipboard operation
sanic copied to clipboard

Sanic failed to start when installed using PDM

Open pyx opened this issue 9 months ago • 11 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

As mentioned in the the book Python Web Developmentwith Sanic, I installed sanic with pdm:

$ mkdir test-sanic
$ cd test-sanic
$ pdm init
... with all default settings
$ pdm run sanic

It failed with: ModuleNotFoundError: No module named 'pkg_resources'

Same error within virtual environment created by pdm as:

$ . .venv/bin/activate
[.venv]$ sanic

python version 3.11 sanic version 23.6.0 pdm version 2.9.2

Code snippet

No response

Expected Behavior

Should be able to run sanic CLI, it worked with virtual environment I created manually.

How do you run Sanic?

Sanic CLI

Operating System

Linux

Sanic Version

23.6.0

Additional context

No response

pyx avatar Sep 25 '23 04:09 pyx