Install Frappe framework in Ubuntu24.04 LTS ( Pip3 install frappe-bench )

frappe-bench) frappe@Rahul:~$ bench init --frappe-branch version-14 frappe-bench
Setting Up Environment
$ python3 -m venv env
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade pip
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet wheel
Getting frappe
$ git clone GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --branch version-14 --depth 1 --origin upstream
Cloning into ‘frappe’…
remote: Enumerating objects: 3246, done.
remote: Counting objects: 100% (3246/3246), done.
remote: Compressing objects: 100% (2874/2874), done.
remote: Total 3246 (delta 374), reused 1884 (delta 261), pack-reused 0
Receiving objects: 100% (3246/3246), 16.34 MiB | 8.84 MiB/s, done.
Resolving deltas: 100% (374/374), done.
Installing frappe
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/frappe
ERROR: Ignored the following yanked versions: 3.6.0a1
ERROR: Ignored the following versions that require a different python version: 5.1 Requires-Python >=2.7, !=3.0., !=3.1., !=3.2., !=3.3., !=3.4., <3.10; 5.2 Requires-Python >=2.7, !=3.0., !=3.1., !=3.2., !=3.3., !=3.4., <3.11; 5.2a1.dev0 Requires-Python >=2.7, !=3.0., !=3.1., !=3.2., !=3.3., !=3.4., <3.11; 5.3 Requires-Python >=2.7, !=3.0., !=3.1., !=3.2., !=3.3., !=3.4., <3.11; 5.3a1.dev0 Requires-Python >=2.7, !=3.0., !=3.1., !=3.2., !=3.3., !=3.4., <3.12; 5.4 Requires-Python >=2.7, !=3.0., !=3.1., !=3.2., !=3.3., !=3.4., <3.11; 6.0 Requires-Python >=3.6, <3.12; 6.0a1.dev0 Requires-Python >=3.6, <3.12; 6.1 Requires-Python >=3.6, <3.12; 6.2 Requires-Python >=3.6, <3.12
ERROR: Could not find a version that satisfies the requirement RestrictedPython~=6.2 (from frappe) (from versions: 3.4.2, 3.4.3, 3.5.0, 3.5.1, 3.5.2, 3.6.0, 4.0a1, 4.0a2, 4.0a3, 4.0b1, 4.0b2, 4.0b3, 4.0b4, 4.0b5, 4.0b6, 4.0b7, 4.0b8, 4.0, 5.0, 7.0a1.dev0, 7.0a1.dev1, 7.0a2.dev0, 7.0, 7.1, 7.2a1.dev0)
ERROR: No matching distribution found for RestrictedPython~=6.2
subprocess.CalledProcessError: Command '/home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/frappe ’ returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/lib/python3.12/dist-packages/bench/commands/make.py”, line 75, in init
init(
File “/usr/local/lib/python3.12/dist-packages/bench/utils/render.py”, line 105, in wrapper_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/dist-packages/bench/utils/system.py”, line 87, in init
get_app(
File “/usr/local/lib/python3.12/dist-packages/bench/app.py”, line 777, in get_app
app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
File “/usr/local/lib/python3.12/dist-packages/bench/utils/render.py”, line 126, in wrapper_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/dist-packages/bench/app.py”, line 254, in install
install_app(
File “/usr/local/lib/python3.12/dist-packages/bench/app.py”, line 909, in install_app
bench.run(
File “/usr/local/lib/python3.12/dist-packages/bench/bench.py”, line 48, in run
return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/dist-packages/bench/utils/init.py”, line 178, in exec_cmd
raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/frappe

ERROR: There was a problem while creating frappe-bench
Do you want to rollback these changes? [y/N]: y
INFO: Rolling back Bench “frappe-bench”

I’m getting this error

Hii @rs115199789

This error is caused by a Python compatibility issue where the version is higher than your current Python version, which is 3.6. For the next/development version of Frappe/ERPNext, 3.10 is the recommended and required version. For more information, visit: build!: Bump minimum Python version to 3.10 by gavindsouza · Pull Request #17355 · frappe/frappe · GitHub

To install a higher version of Python, use the following command:
sudo apt install python3.10-dev

1 Like

i tried and get this error- frappe@Rahul:~$ sudo apt install python3.10-dev
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
python3.10-dev is already the newest version (3.10.14-1+noble2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

shall i install ubuntu 22.04 and then try from start ?

Thank You

@rs115199789 What version of Ubuntu do you use ?

@Faris_Alsolmi
Brother I’m using Ubuntu 24.04 LTS

I believe there is no need to reinstall Ubuntu from scratch if you are still facing this issue, so try starting over.

just wanted to install erpnext v14 in ubuntu and run on local server for education, but stuck at this issue

if you have any other solutions do let me know thank you and yes I’m still facing this issues, everything is installed perfectly only this pip is creating issue, I’m not much into codes.

I was facing the same issue , then I installed frappe inside the python env,

cd frappe-bench

then:

source frappe-bench/bin/activate

then initiate your bench inside the python environment itself:

bench init --frappe-branch version-14 frappe-bench

I hope this could help you. Thank you

i tried but now getting this error- frappe@Rahul:~$ bench init frappe-bench
Setting Up Environment
$ python3 -m venv env
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade pip
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet wheel
Getting frappe
$ git clone GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --depth 1 --origin upstream
Cloning into ‘frappe’…
remote: Enumerating objects: 3274, done.
remote: Counting objects: 100% (3274/3274), done.
remote: Compressing objects: 100% (2778/2778), done.
remote: Total 3274 (delta 509), reused 1685 (delta 383), pack-reused 0
Receiving objects: 100% (3274/3274), 11.42 MiB | 5.55 MiB/s, done.
Resolving deltas: 100% (509/509), done.
Installing frappe
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/frappe

$ yarn install --check-files
yarn install v1.22.22
[1/5] Validating package.json…
error frappe-framework@: The engine “node” is incompatible with this module. Expected version “>=18”. Got “16.15.0”
error Found incompatible module.
info Visit yarn install | Yarn for documentation about this command.
subprocess.CalledProcessError: Command ‘yarn install --check-files’ returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/lib/python3.12/dist-packages/bench/commands/make.py”, line 75, in init
init(
File “/usr/local/lib/python3.12/dist-packages/bench/utils/render.py”, line 105, in wrapper_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/dist-packages/bench/utils/system.py”, line 87, in init
get_app(
File “/usr/local/lib/python3.12/dist-packages/bench/app.py”, line 777, in get_app
app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
File “/usr/local/lib/python3.12/dist-packages/bench/utils/render.py”, line 126, in wrapper_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/dist-packages/bench/app.py”, line 254, in install
install_app(
File “/usr/local/lib/python3.12/dist-packages/bench/app.py”, line 920, in install_app
bench.run(yarn_install, cwd=app_path)
File “/usr/local/lib/python3.12/dist-packages/bench/bench.py”, line 48, in run
return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/dist-packages/bench/utils/init.py”, line 178, in exec_cmd
raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: yarn install --check-files

ERROR: There was a problem while creating frappe-bench

Did you switch to the python env? before you initiate your bench, the prompt in your temrinal will look like this :

(frappe-bench) frappe@Rahul: /frappe-bench$ 

then Initiate your bench:

bench init frappe-bench

Also, it seems that your node is less than 18 version, try update your nod and yarn versions from steps in this guide Frappe-ERPNext-Version-15–in-Ubuntu-22.04

espcially theses commoands:

nvm install 20
sudo apt-get install npm
sudo npm install -g yarn

@Faris_Alsolmi

again new error- frappe@Rahul:~$ source frappe-bench/bin/activate
(frappe-bench) frappe@Rahul:~$ bench init --frappe-branch version-14 frappe-bench
ERROR: Bench instance already exists at frappe-bench

I will download 22.04 and try to install erp again, if you have any solution or guide do share .

thank you

Hi Faris, Let me hijack you, I did all that and got an error. I posted here, Compose Fail To Start When Installing From Frappe-Manager on WSL2 Ubuntu 22.04

Hi @rs115199789 I exactly used the same steps , Install frappe framework on Ubuntu 24.04 LTS and it worked for me with errors.

@Faris_Alsolmi okay thanks alot for the guide ill try this if my ubuntu 22 fails, i re-install ubuntu 22 and tried to install erp, but when i try to create site it gives me error, you can check here- Bench new site create error

1 Like

@rs115199789
did you use the script?, i used it many times and did not have any problem!.
@flexy2ky is the script creator, he is helpful, may help you in this situation.

i installed 3rd time and now it’s working fine , i was just testing , and will switch to windows again after sometime.

Thanks

Great to hear that good luck with frappe :slight_smile:

1 Like

@rs115199789 Happy to hear so, Good Luck with Frappe ! :star_struck:

Please if any of the above replies was the solution please indicate it so that others will not stuck at some points with frappe installation, or if it was different way could you please post it and mark it as solution. Thank you :innocent:

1 Like

It was a issue with my python and Ubuntu version and while installing the app I tried to create user and then did something wrong with the path I guess but then I saw the video tutorial of @TRACKOMATIC_INDIA as earlier it was quite helpful and boom again I’m able to install the same.

Thanks to all of you.

1 Like