Frappe and Python 3.14

Trying to install Frappe v16 and installed the virtual environment for this with:

Guide to upgrading bench Frappe and ERPNext from v15 to v16 on Debian 12 what worked well on Ubuntu 24.04

The choice to make was python 3.14.1 or python 3.14.2 use python 3.14.2 I get this message when

ERROR: Package ‘frappe’ requires a different Python: 3.14.2 not in ‘<3.14,>=3.10’

Please update the requirements so that python 3.14.2 or newer versions will fit to install frappe v16

If you read the comments on the guide you can see another user that had the same problem and what we discussed.

frappe v16 works perfect with python 3.14.2. frappe v16 wont work with any older versions than v 3.14.

Doing :

pyenv install --list | grep 3.14
3.14.0
3.14.0t
3.14-dev
3.14t-dev
3.14.1
3.14.1t
3.14.2
3.14.2t
miniconda2-4.3.14
miniconda3-4.3.14
pypy2.7-7.3.14-src
pypy2.7-7.3.14
pypy3.9-7.3.14-src
pypy3.9-7.3.14
pypy3.10-7.3.14-src
pypy3.10-7.3.14

Using and installed any version starting with 3.14.0 or above will result in:

ERROR: Package ‘frappe’ requires a different Python: 3.14.0 not in ‘<3.14,>=3.10’

So… the version 3.14 will work as soon the requirement of 3.14 will be set to 3.14.0, 3.14.1 or 3.14.2 and frappe v16 can be installed

when i check my installation like this:

cd /frappe-bench/apps/frappe

git rev-parse --abbrev-ref HEAD

i get:
version-16

and then i run

grep -n “requires-python” -n pyproject.toml

i get:
7:requires-python = “>=3.14,<3.15”

it have to work with v 3.14.2 if your installing v16

run these commands and paste output so we can get to the bottom of this:

cd ~/frappe-bench

confirm which frappe directory bench is using

ls -la apps/frappe
realpath apps/frappe

confirm branch and pyproject requires-python in THAT directory

cd apps/frappe
git rev-parse --abbrev-ref HEAD
git log -1 --oneline
grep -n ‘requires-python’ pyproject.toml

confirm pip is installing THAT path

cd ~/frappe-bench
source env/bin/activate
python -c “import sys; print(sys.executable); print(sys.version)”
pip -V
pip install -vvv -e apps/frappe 2>&1 | tail -n 60

cd /frappe-bench/apps/frappe

git rev-parse --abbrev-ref HEAD

Give: Version-15

grep -n “requires-python” -n pyproject.toml

Give nothing back

ls -la apps/frappe

Give:

ls -la apps/frappe
total 328
drwxrwxr-x 9 nexterp nexterp 4096 Jan 15 08:46 .
drwxrwxr-x 4 nexterp nexterp 4096 Jan 15 09:55 ..
-rw-rw-r-- 1 nexterp nexterp 386 Jan 7 12:10 .coveragerc
-rw-rw-r-- 1 nexterp nexterp 406 Jan 7 12:10 .editorconfig
-rw-rw-r-- 1 nexterp nexterp 278 Jan 7 12:10 .eslintignore
-rw-rw-r-- 1 nexterp nexterp 2516 Jan 7 12:10 .eslintrc
drwxrwxr-x 8 nexterp nexterp 4096 Jan 16 16:32 .git
-rw-rw-r-- 1 nexterp nexterp 1247 Jan 7 12:10 .git-blame-ignore-revs
drwxrwxr-x 5 nexterp nexterp 4096 Jan 7 12:10 .github
-rw-rw-r-- 1 nexterp nexterp 2465 Jan 7 12:10 .gitignore
-rw-rw-r-- 1 nexterp nexterp 1839 Jan 7 12:10 .mergify.yml
-rw-rw-r-- 1 nexterp nexterp 2247 Jan 7 12:10 .pre-commit-config.yaml
-rw-rw-r-- 1 nexterp nexterp 597 Jan 7 12:10 .releaserc
-rw-rw-r-- 1 nexterp nexterp 0 Jan 7 12:10 .semgrepignore
-rw-rw-r-- 1 nexterp nexterp 220 Jan 7 12:10 CODEOWNERS
-rw-rw-r-- 1 nexterp nexterp 3212 Jan 7 12:10 CODE_OF_CONDUCT.md
-rw-rw-r-- 1 nexterp nexterp 1118 Jan 7 12:10 LICENSE
-rw-rw-r-- 1 nexterp nexterp 3234 Jan 7 12:10 README.md
-rw-rw-r-- 1 nexterp nexterp 556 Jan 7 12:10 SECURITY.md
-rw-rw-r-- 1 nexterp nexterp 1507 Jan 7 12:10 attributions.md
-rw-rw-r-- 1 nexterp nexterp 741 Jan 7 12:10 babel_extractors.csv
-rw-rw-r-- 1 nexterp nexterp 1183 Jan 7 12:10 codecov.yml
-rw-rw-r-- 1 nexterp nexterp 394 Jan 7 12:10 commitlint.config.js
-rw-rw-r-- 1 nexterp nexterp 444 Jan 7 12:10 crowdin.yml
drwxrwxr-x 6 nexterp nexterp 4096 Jan 7 12:10 cypress
-rw-rw-r-- 1 nexterp nexterp 701 Jan 7 12:10 cypress.config.js
drwxrwxr-x 2 nexterp nexterp 4096 Jan 7 12:10 esbuild
drwxrwxr-x 36 nexterp nexterp 4096 Jan 15 08:46 frappe
-rw-rw-r-- 1 nexterp nexterp 568 Jan 7 12:10 generate_bootstrap_theme.js
-rw-rw-r-- 1 nexterp nexterp 890 Jan 7 12:10 hooks.md
drwxrwxr-x 418 nexterp nexterp 20480 Jan 7 12:14 node_modules
-rw-rw-r-- 1 nexterp nexterp 2047 Jan 7 12:10 node_utils.js
-rw-rw-r-- 1 nexterp nexterp 2471 Jan 7 12:10 package.json
-rw-r–r-- 1 nexterp nexterp 4270 Jan 15 08:46 pyproject.toml
drwxrwxr-x 4 nexterp nexterp 4096 Jan 7 12:10 realtime
-rw-rw-r-- 1 nexterp nexterp 37 Jan 7 12:10 sider.yml
-rw-rw-r-- 1 nexterp nexterp 23 Jan 7 12:10 socketio.js
-rw-rw-r-- 1 nexterp nexterp 165354 Jan 7 12:10 yarn.lock

cd apps/frappe
git rev-parse --abbrev-ref HEAD

Give:

Version-15

git log -1 --oneline

Give:

59a92b53ac (HEAD → version-15, tag: v15.96.0, upstream/version-15) chore(release): Bumped to Version 15.96.0

grep -n ‘requires-python’ pyproject.toml

Give no answer

cd ~/frappe-bench
source env/bin/activate

Give:

-bash: env/bin/activate: No such file or directory

python -c “import sys; print(sys.executable); print(sys.version)”

GIve:

-bash: syntax error near unexpected token `sys.executable’

pip-V

Give:

pip 25.2 from /opt/nexterp/.pyenv/versions/3.14.0/lib/python3.14/site-packages/pip (python 3.14)

pip install -vvv -e apps/frappe 2>&1 | tail -n 60
Give:

Using pip 25.2 from /opt/nexterp/.pyenv/versions/3.14.0/lib/python3.14/site-packages/pip (python 3.14)
Non-user install because site-packages writeable
Created temporary directory: /tmp/pip-build-tracker-oi6row5u
Initialized build tracking at /tmp/pip-build-tracker-oi6row5u
Created build tracker: /tmp/pip-build-tracker-oi6row5u
Entered build tracker: /tmp/pip-build-tracker-oi6row5u
Created temporary directory: /tmp/pip-install-em1x0vl4
Remote version of pip: 25.3
Local version of pip: 25.2
Was pip installed by pip? True

[notice] A new release of pip is available: 25.2 → 25.3
[notice] To update, run: pip install --upgrade pip
ERROR: apps/frappe is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).
Exception information:
Traceback (most recent call last):
File “/opt/nexterp/.pyenv/versions/3.14.0/lib/python3.14/site-packages/pip/_internal/cli/base_command.py”, line 107, in _run_wrapper
status = _inner_run()
File “/opt/nexterp/.pyenv/versions/3.14.0/lib/python3.14/site-packages/pip/_internal/cli/base_command.py”, line 98, in _inner_run
return self.run(options, args)
~~~~~~~~^^^^^^^^^^^^^^^
File “/opt/nexterp/.pyenv/versions/3.14.0/lib/python3.14/site-packages/pip/_internal/cli/req_command.py”, line 71, in wrapper
return func(self, options, args)
File “/opt/nexterp/.pyenv/versions/3.14.0/lib/python3.14/site-packages/pip/_internal/commands/install.py”, line 357, in run
reqs = self.get_requirements(args, options, finder, session)
File “/opt/nexterp/.pyenv/versions/3.14.0/lib/python3.14/site-packages/pip/_internal/cli/req_command.py”, line 261, in get_requirements
req_to_add = install_req_from_editable(
req,
…<3 lines>…
config_settings=getattr(options, “config_settings”, None),
)
File “/opt/nexterp/.pyenv/versions/3.14.0/lib/python3.14/site-packages/pip/_internal/req/constructors.py”, line 237, in install_req_from_editable
parts = parse_req_from_editable(editable_req)
File “/opt/nexterp/.pyenv/versions/3.14.0/lib/python3.14/site-packages/pip/_internal/req/constructors.py”, line 206, in parse_req_from_editable
name, url, extras_override = parse_editable(editable_req)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File “/opt/nexterp/.pyenv/versions/3.14.0/lib/python3.14/site-packages/pip/_internal/req/constructors.py”, line 129, in parse_editable
raise InstallationError(
…<3 lines>…
)
pip._internal.exceptions.InstallationError: apps/frappe is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).
Removed build tracker: ‘/tmp/pip-build-tracker-oi6row5u’

You’re not in a bench virtualenv right now. source env/bin/activate fails because ~/frappe-bench/env doesn’t exist, and pip -V shows you’re using global pyenv pip. Also you’re still on Frappe version-15 (v15.96.0).

Please follow the guide and don’t skip any of the steps

OK will try again

One problem I could not solve is:

/opt/nexterp/frappe-bench/env/bin/python: Error while finding module specification for ‘frappe.utils.bench_helper’ (ModuleNotFoundError: No module named ‘frappe’)

This error comes after bench update –patch

That error means your bench venv exists, but frappe is not installed inside it, so bench can’t import frappe.utils.bench_helper.

Fix:

cd /opt/nexterp/frappe-bench
source env/bin/activate

pip install -U pip wheel setuptools
pip install -e apps/frappe
pip install -e apps/erpnext
pip install -e apps/hrms

python -c "import frappe; print(frappe.__version__)"
bench update --patch

If pip install -e apps/frappe fails, don’t continue until it succeeds (otherwise bench will stay broken)

When execute pip install -e apps/frappe

I get this

Collecting mysqlclient==2.2.7 (from frappe==16.1.1)
Using cached mysqlclient-2.2.7.tar.gz (91 kB)
Installing build dependencies … done
Getting requirements to build wheel … error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [31 lines of output]
Trying pkg-config --exists mysqlclient
Command ‘pkg-config --exists mysqlclient’ returned non-zero exit status 1.
Trying pkg-config --exists mariadb
Command ‘pkg-config --exists mariadb’ returned non-zero exit status 1.
Trying pkg-config --exists libmariadb
Command ‘pkg-config --exists libmariadb’ returned non-zero exit status 1.
Trying pkg-config --exists perconaserverclient
Command ‘pkg-config --exists perconaserverclient’ returned non-zero exit status 1.
Traceback (most recent call last):
File “/opt/nexterp/frappe-bench/env/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 389, in
main()
~~~~^^
File “/opt/nexterp/frappe-bench/env/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 373, in main
json_out[“return_val”] = hook(**hook_input[“kwargs”])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/nexterp/frappe-bench/env/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/in_process.py", line 143, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-i9im0og
/overlay/lib/python3.14/site-packages/setuptools/build_meta.py”, line 331, in get_requires_for_build_wheel
return self.get_build_requires(config_settings, requirements=[])
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-i9im0og
/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 301, in get_build_requires
self.run_setup()
~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-i9im0og
/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 317, in run_setup
exec(code, locals())
~~~~^^^^^^^^^^^^^^^^
File “”, line 156, in
File “”, line 49, in get_config_posix
File “”, line 28, in find_package_name
Exception: Can not find valid pkg-config name.
Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

What linux are you using?

Ubuntu 24.04 LTS

keeping the same errors after

/frappe-bench$ pip install -e apps/frappe

Collecting mysqlclient==2.2.7 (from frappe==16.1.1)
Using cached mysqlclient-2.2.7.tar.gz (91 kB)
Installing build dependencies … done
Getting requirements to build wheel … error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [31 lines of output]
Trying pkg-config --exists mysqlclient
Command ‘pkg-config --exists mysqlclient’ returned non-zero exit status 1.
Trying pkg-config --exists mariadb
Command ‘pkg-config --exists mariadb’ returned non-zero exit status 1.
Trying pkg-config --exists libmariadb
Command ‘pkg-config --exists libmariadb’ returned non-zero exit status 1.
Trying pkg-config --exists perconaserverclient
Command ‘pkg-config --exists perconaserverclient’ returned non-zero exit status 1.
Traceback (most recent call last):
File “/opt/nexterp/.pyenv/versions/3.14.2/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 389, in
main()
~~~~^^
File “/opt/nexterp/.pyenv/versions/3.14.2/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 373, in main
json_out[“return_val”] = hook(**hook_input[“kwargs”])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/nexterp/.pyenv/versions/3.14.2/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 143, in get_requires_for_build_wheel
return hook(config_settings)
File “/tmp/pip-build-env-bd00de44/overlay/lib/python3.14/site-packages/setuptools/build_meta.py”, line 331, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/tmp/pip-build-env-bd00de44/overlay/lib/python3.14/site-packages/setuptools/build_meta.py”, line 301, in _get_build_requires
self.run_setup()
~~~~~~~~~~~~~~^^
File “/tmp/pip-build-env-bd00de44/overlay/lib/python3.14/site-packages/setuptools/build_meta.py”, line 317, in run_setup
exec(code, locals())
~~~~^^^^^^^^^^^^^^^^
File “”, line 156, in
File “”, line 49, in get_config_posix
File “”, line 28, in find_package_name
Exception: Can not find valid pkg-config name.
Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
[end of output]

what part of debian 12 sounds like ubuntu 22