Django poetry deploy error

Hi. Every time I try to deploy my simplest Django app, I get the following error: build failed:

Repl link/Link to where the bug appears: https://wayleft-potap75.replit.app/

Screenshots, links, or other helpful context:

--> poetry lock --no-update

  TypeError

  expected string or bytes-like object


  at venv/lib/python3.8/site-packages/poetry/core/utils/helpers.py:27 in canonicalize_name

       24│ 
       25│ 
       26│ def canonicalize_name(name):  # type: (str) -> str

/home/runner/fa4bd2b8-a8fc-4961-b707-b428826e3d2d/venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(

exit status 1

Did some digging on the internet, try putting this in a new .py file and calling it in the Shell tab:

from os import environ, remove, rmdir
from shutil import rmtree
from sys import version_info

import importlib_metadata as metadata

MODULES_PATH = [
    f"{environ['REPL_HOME']}/venv/lib/python{version_info.major}.{version_info.minor}/site-packages",
]

if __name__ == '__main__':
    for pkg in filter(lambda a: a.metadata["name"] is None, metadata.distributions(path=MODULES_PATH)):
        print("Erasing", pkg._path)
        if pkg._path.is_dir():
            rmtree(pkg._path)
        else:
            remove(pkg._path)

Then try running poetry lock --no-update

Hey, thank you! It worked through build and bundle, then got stuck on Promote:

info: Language - 2023-08-14T21:06:30Z
info: Pushing pid1 binary layer... - 2023-08-14T21:06:30Z
info: Created pid1 binary layer - 2023-08-14T21:06:31Z
info: Skipping Python layer creation - 2023-08-14T21:06:37Z
info: Pushing hosting layer... - 2023-08-14T21:06:37Z
info: Pushing Repl layer... - 2023-08-14T21:06:37Z
info: Retrieved cached nix layer - 2023-08-14T21:06:37Z
info: Created hosting layer - 2023-08-14T21:06:37Z
info: Created Repl layer - 2023-08-14T21:07:14Z
info: Pushing Repl (cache) layer... - 2023-08-14T21:07:14Z
info: Created Repl (cache) layer - 2023-08-14T21:07:30Z
info: Pushed image manifest - 2023-08-14T21:07:30Z
info: Pushed soci index manifest - 2023-08-14T21:07:31Z
info: Pushed referrer manifest - 2023-08-14T21:07:31Z
info: Creating virtual machine - 2023-08-14T21:07:38.792Z
info: Virtual machine created - 2023-08-14T21:07:48.849Z
info: Waiting for deployment to be ready - 2023-08-14T21:07:48.957Z

Hmm. I’m not sure there. I think that’s a different issue, so I will ping a staff member about this.

In the meantime, id recommend watching a few other posts about the “Promote” issue:

1 Like