Giter Site home page Giter Site logo

Comments (11)

sunnad99 avatar sunnad99 commented on September 23, 2024 2

I encountered the same issue @kytta

I, temporarily, solved my issue by downgrading to python 3.9.

https://github.com/orgs/vercel/discussions/6729

from vercel.

ernests avatar ernests commented on September 23, 2024 1

There is a pull request which solves the problem - #11541

from vercel.

sunnad99 avatar sunnad99 commented on September 23, 2024 1

I also hit this issue - would really like to avoid downgrading both node and python - any idea when the associated PR will be merged and released?

I would say, switch to flask. Sanic won't work either since its an async framework like FastAPI.

If you can't change the code, I suggest using render.com then because clearly Vercel don't have time for the python community.

Also need to set node version to 18.x in package.json using the code below

{
    "engines": {
        "node": "18.x"
    }
}

I actually didn't have to do this, it worked just from changing the setting from the vercel dashboard in the project settings.

from vercel.

PaParaZz1 avatar PaParaZz1 commented on September 23, 2024

I encountered the same issue @kytta

I, temporarily, solved my issue by downgrading to python 3.9.

https://github.com/orgs/vercel/discussions/6729

Could you please provide an example of vercel.json? I have changed my settings to py3.9 but it doesn't work (still py3.12).

{
  "builds": [
    {
      "src": "main.py",
      "use": "@vercel/python",
      "config": {
        "legacy": true
      }
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "main.py"
    }
  ]
}

from vercel.

sunnad99 avatar sunnad99 commented on September 23, 2024

I encountered the same issue @kytta
I, temporarily, solved my issue by downgrading to python 3.9.
https://github.com/orgs/vercel/discussions/6729

Could you please provide an example of vercel.json? I have changed my settings to py3.9 but it doesn't work (still py3.12).

{
  "builds": [
    {
      "src": "main.py",
      "use": "@vercel/python",
      "config": {
        "legacy": true
      }
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "main.py"
    }
  ]
}

There is nothing wrong with your config. Also, the config field in the builds object is unnecessary. To tell vercel to pick up the correct version of python, you need to add the "Pipfile" and "Pipfile.lock"

My vercel.json config file looks like:

{
  "builds": [
    {
      "src": "app.py",
      "use": "@vercel/python"
    }
  ],
  "routes": [
    {
      "src": "(.*)",
      "dest": "app.py"
    }
  ]
}

My pipfile looks like:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
fastapi = "==0.111.0"
requests = "==2.31.0"
beautifulsoup4 = "==4.12.3"
html2text = "==2024.2.26"
validators = "==0.28.1"

[dev-packages]

[requires]
python_version = "3.9"
python_full_version = "3.9.13"

Check the following links out for more info:
https://vercel.com/docs/functions/runtimes/python#python-version
https://vercel.com/docs/deployments/build-image/build-image-legacy
https://vercel.com/docs/functions/runtimes/node-js#setting-the-node.js-version-in-project-settings

from vercel.

sunnad99 avatar sunnad99 commented on September 23, 2024

There is a pull request which solves the problem - #11541

yes, but while its not live, the solution should be made clear to the users

from vercel.

jeremyk avatar jeremyk commented on September 23, 2024

I also hit this issue - would really like to avoid downgrading both node and python - any idea when the associated PR will be merged and released?

from vercel.

Zapzatron avatar Zapzatron commented on September 23, 2024

Same problem, waiting for the PR to be accepted

from vercel.

adamstoffel avatar adamstoffel commented on September 23, 2024

+1 FastAPI does not work until this is fixed.

from vercel.

kneelesh48 avatar kneelesh48 commented on September 23, 2024

Also need to set node version to 18.x in package.json using the code below

{
    "engines": {
        "node": "18.x"
    }
}

from vercel.

kytta avatar kytta commented on September 23, 2024

Closed via #11675

from vercel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.