Vercel using Python Runtime 3.9 instead of 3.12

Hi Team

I was trying to build a project in vercel and realised vercel is using python 3.9.8 instead of 3.12 which is leading to multiple build fails. Is there a way to fix the python version of the runtime?

This is the pipfile I’m using, but the version is still 3.9.8

Hi @krypticmouse, welcome to the Vercel Community!

Sorry that you’re facing this issue. Can you confirm you are following this:

When upgrading to 3.12 , ensure you set Node.js 20.x or 22.x in your project settings.

Hi Anshuman!

I did do that but I’m not sure why but when I do that pip works but all the dependencies it installs don’t work, almost as if the shell is different

Installing collected packages: webencodings, wcwidth, pytz, pure-eval, ptyprocess, paginate, magicattr, fastjsonschema, zipp, xxhash, watchdog, urllib3, ujson, tzdata, typing_extensions, traitlets, tqdm, tornado, tinycss2, tenacity, soupsieve, sniffio, six, rpds-py, regex, pyzmq, pyyaml, python-dotenv, pygments, pycparser, pyarrow, psutil, propcache, prompt_toolkit, platformdirs, pillow, pexpect, pathspec, parso, pandocfilters, packaging, numpy, nest-asyncio, multidict, mkdocs-material-extensions, mistune, mergedeep, mdurl, markupsafe, markdown, jupyterlab-pygments, json-repair, joblib, jiter, idna, h11, greenlet, fsspec, frozenlist, filelock, executing, distro, diskcache, dill, defusedxml, decorator, debugpy, colorlog, colorama, cloudpickle, click, charset-normalizer, certifi, cachetools, bleach, backrefs, backoff, babel, attrs, asttokens, annotated-types, aiohappyeyeballs, yarl, stack_data, sqlalchemy, requests, referencing, pyyaml-env-tag, python-dateutil, pymdown-extensions, pydantic-core, multiprocess, mkdocs-get-deps, matplotlib-inline, markdown-it-py, Mako, jupyter-core, jinja2, jedi, ipython-pygments-lexers, importlib-metadata, httpcore, griffe, cssselect2, comm, cffi, beautifulsoup4, anyio, aiosignal, tiktoken, rich, pydantic, pandas, mdit-py-plugins, jupyter-client, jsonschema-specifications, ipython, huggingface-hub, httpx, ghp-import, cairocffi, asyncer, alembic, aiohttp, tokenizers, optuna, openai, mkdocs, jsonschema, ipykernel, cairosvg, nbformat, mkdocs-redirects, mkdocs-material, mkdocs-autorefs, litellm, datasets, nbclient, mkdocstrings, jupytext, dspy, nbconvert, mkdocstrings-python, mkdocs-jupyter
Successfully installed Mako-1.3.9 aiohappyeyeballs-2.6.1 aiohttp-3.11.14 aiosignal-1.3.2 alembic-1.15.1 annotated-types-0.7.0 anyio-4.9.0 asttokens-3.0.0 asyncer-0.0.8 attrs-25.3.0 babel-2.17.0 backoff-2.2.1 backrefs-5.8 beautifulsoup4-4.13.3 bleach-6.2.0 cachetools-5.5.2 cairocffi-1.7.1 cairosvg-2.7.1 certifi-2025.1.31 cffi-1.17.1 charset-normalizer-3.4.1 click-8.1.8 cloudpickle-3.1.1 colorama-0.4.6 colorlog-6.9.0 comm-0.2.2 cssselect2-0.8.0 datasets-3.4.1 debugpy-1.8.13 decorator-5.2.1 defusedxml-0.7.1 dill-0.3.8 diskcache-5.6.3 distro-1.9.0 dspy-2.6.14 executing-2.2.0 fastjsonschema-2.21.1 filelock-3.18.0 frozenlist-1.5.0 fsspec-2024.12.0 ghp-import-2.1.0 greenlet-3.1.1 griffe-1.6.2 h11-0.14.0 httpcore-1.0.7 httpx-0.28.1 huggingface-hub-0.29.3 idna-3.10 importlib-metadata-8.6.1 ipykernel-6.29.5 ipython-9.0.2 ipython-pygments-lexers-1.1.1 jedi-0.19.2 jinja2-3.1.6 jiter-0.9.0 joblib-1.4.2 json-repair-0.40.0 jsonschema-4.23.0 jsonschema-specifications-2024.10.1 jupyter-client-8.6.3 jupyter-core-5.7.2 jupyterlab-pygments-0.3.0 jupytext-1.16.7 litellm-1.63.7 magicattr-0.1.6 markdown-3.7 markdown-it-py-3.0.0 markupsafe-3.0.2 matplotlib-inline-0.1.7 mdit-py-plugins-0.4.2 mdurl-0.1.2 mergedeep-1.3.4 mistune-3.0.2 mkdocs-1.6.1 mkdocs-autorefs-1.4.1 mkdocs-get-deps-0.2.0 mkdocs-jupyter-0.25.1 mkdocs-material-9.6.9 mkdocs-material-extensions-1.3.1 mkdocs-redirects-1.2.2 mkdocstrings-0.29.0 mkdocstrings-python-1.16.7 multidict-6.2.0 multiprocess-0.70.16 nbclient-0.10.2 nbconvert-7.16.6 nbformat-5.10.4 nest-asyncio-1.6.0 numpy-2.2.4 openai-1.61.0 optuna-4.2.1 packaging-24.2 paginate-0.5.7 pandas-2.2.3 pandocfilters-1.5.1 parso-0.8.4 pathspec-0.12.1 pexpect-4.9.0 pillow-10.4.0 platformdirs-4.3.7 prompt_toolkit-3.0.50 propcache-0.3.0 psutil-7.0.0 ptyprocess-0.7.0 pure-eval-0.2.3 pyarrow-19.0.1 pycparser-2.22 pydantic-2.10.6 pydantic-core-2.27.2 pygments-2.19.1 pymdown-extensions-10.14.3 python-dateutil-2.9.0.post0 python-dotenv-1.0.1 pytz-2025.1 pyyaml-6.0.2 pyyaml-env-tag-0.1 pyzmq-26.3.0 referencing-0.36.2 regex-2024.11.6 requests-2.32.3 rich-13.9.4 rpds-py-0.23.1 six-1.17.0 sniffio-1.3.1 soupsieve-2.6 sqlalchemy-2.0.39 stack_data-0.6.3 tenacity-9.0.0 tiktoken-0.9.0 tinycss2-1.4.0 tokenizers-0.21.1 tornado-6.4.2 tqdm-4.67.1 traitlets-5.14.3 typing_extensions-4.12.2 tzdata-2025.2 ujson-5.10.0 urllib3-1.26.6 watchdog-6.0.0 wcwidth-0.2.13 webencodings-0.5.1 xxhash-3.5.0 yarl-1.18.3 zipp-3.21.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[notice] A new release of pip is available: 24.0 -> 25.0.1
[notice] To update, run: python3.12 -m pip install --upgrade pip
sh: line 1: mkdocs: command not found
Error: Command "mkdocs build" exited with 127

like in this case mkdocs is installed but it’s not able to identify it in build

Hi @krypticmouse, you shouldn’t do pip install manually in Vercel.

Hi @anshumanb!

Thank you so much for the response!!

What should be the proper way out for this?

I have a pipfile but what should be my install command?

Hi @krypticmouse, Vercel will install the packages automatically from the requirements file.

Try removing the requirements file and see if that helps.

Hello, I have a project running MkDocs on Vercel,

but I recently discovered that there is a problem with it working on Node 20.x and 22.x.
I’ve commented on the MkDocs discussion about the solution to this, and I’ve also updated Vercel-MkDocs.

I hope this will lead to your solution.

p.s. I’ve been a Vercel user since the now.sh days. This is my first post in this community.

1 Like

To the Vercel staff,

Unfortunately, the way Python works in Vercel is different between Node 18.x and Node 20.x, 22.x.
As a result, we may see an increase in reports of Python-related issues over the next few months.

Specifically, the installed Python library (pip) is not visible and is marked as Not Found.
MkDocs has experienced this. I needed to make some modifications to the source.
Hopefully this can be resolved at the build image level before Node18 expires.

1 Like

Hi @balloon, thanks for highlighting this. Glad to meet another now.sh user I’ve been a Vercel user since then. :handshake:

We’ve shared this information with out team. I’ll keep the thread updated.

1 Like

Hey, sorry for the late reply

This does turn out to be expected. Python has upgraded from 3.9 to 3.12 and the available binaries are python3 and pip3