RobertCraigie / prisma-client-py

Prisma Client Python is an auto-generated and fully type-safe database client designed for ease of use
https://prisma-client-py.readthedocs.io
Apache License 2.0
1.89k stars 81 forks source link

Generator cannot start #694

Open coyotespike opened 1 year ago

coyotespike commented 1 year ago

Bug description

When I run prisma generate, I see the error:

Environment variables loaded from .env
Prisma schema loaded from schema.prisma
Error: Generator at prisma-client-py could not start:

/bin/sh: prisma-client-py: command not found

Expected behavior

My requirements.txt includes prisma and pip install -U prisma says requirement already satisfied. So I'm puzzled! I'm also going to hit the Vercel bug but one step at a time ;)

Prisma information


datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider        = "prisma-client-py"
  interface            = "asyncio"
  recursive_type_depth = 5
}

Environment & setup

prisma                  : 4.10.0
prisma client python    : 0.8.1a
platform                : darwin
expected engine version : ca7fcef713137fa11029d519a9780db130cca91d
install path            : /opt/anaconda3/lib/python3.7/site-packages/prisma
installed extras        : []
RobertCraigie commented 1 year ago

@coyotespike I suspect this is an issue with the anaconda setup somehow.

Under the hood, setting provider to prisma-client-py just results in the Prisma CLI calling the prisma-client-py script that should be installed when you install the prisma package. To immediately unblock yourself you may be able to change prisma-client-py to python -m prisma as they are equivalent.

As you're running the prisma command yourself its very strange that it isn't able to resolve the prisma-client-py script...

If you run prisma-client-py in your terminal does it resolve the script correctly?

ProfXponent commented 1 year ago

python -m prisma

I experience the same error while setting up an debian vm on gcloud

did not experience this issue while developing locally on arm64 mac

setting the generator to python3 -m prisma did resolve the issue.

jryebread commented 1 year ago

@ProfXponent have this same issue, so you changed your client to:

generator client { provider = "python3 -m prisma" recursive_type_depth = "5" interface = "sync" }

?? im still getting: /usr/bin/python3: No module named prisma error

ProfXponent commented 1 year ago

@ProfXponent have this same issue, so you changed your client to:

generator client { provider = "python3 -m prisma" recursive_type_depth = "5" interface = "sync" }

?? im still getting: /usr/bin/python3: No module named prisma error

could be that you installed prisma wrong or your pip installer is not linked to python3