prisma-client-py icon indicating copy to clipboard operation
prisma-client-py copied to clipboard

Generator cannot start

Open coyotespike opened this issue 2 years ago • 4 comments

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

  • OS: Mac OS
  • Database: PostgreSQL
  • Python version: Python 3.7.15
  • Prisma version:
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        : []

coyotespike avatar Feb 11 '23 15:02 coyotespike

@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?

RobertCraigie avatar Feb 11 '23 16:02 RobertCraigie

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.

ProfXponent avatar Apr 11 '23 09:04 ProfXponent

@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

jryebread avatar Apr 18 '23 03:04 jryebread

@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

ProfXponent avatar Apr 25 '23 10:04 ProfXponent