Easy install setup guide for erpnext installation on Ubuntu 20.04 LTS. With some modification of course

I will do all step: in file debian_family.yml, redhat_family.yml and download wkhtmltox.deb
Then i run again: sudo python3 install.py --production --user Your_USERNAME --mariadb-version 10.5 --verbose

Thank you for the guide
I’ve followed it step by step, including wkhtmltox.deb step

But I have the error below

Would appreciate your help and guidance
Thank you




I have followed all the steps , came to this final page, but not any action after this , still 5 hrs this is showing .

I was getting this screen for a long time, almost for 5 hours, can you suggest the next step

1 Like

Same error like folk above “ModuleNotFoundError: No module named ‘erpnext’”

There is an issue here still. I have followed all the instructions and used the install.py from Google drive link shared above.

First of All Thank you very much for your help for setting up erpnext. This is my first post and sorry if any mistakes.

I also faced the same issue as ModuleNotFoundError: No module named ‘erpnext .

So I checked and followed this https://medium.com/@binodpaneru23/setting-up-erpnext-in-mac-os-c475466f5403

Based on this doc I used frappe-bench/env/bin/pip3 install -U -e ./apps/erpnext
Again I got stuck with Cython is required to compile pandas from a development branch. error.
Then I checked this post [Bench installation of erpnext fails on pandas setup if numpy>=1.19.0 · Issue #22424 · frappe/erpnext · GitHub]
Based on this doc I used the following commands:
frappe-bench/env/bin/pip3 install pandas==0.24.2
frappe-bench/env/bin/pip install numpy==1.18.5
After this I did frappe-bench/env/bin/pip3 install -U -e ./apps/erpnext and it was successful.
Once I finished the erpnext installation I continued with the command sudo frappe-bench/env/bin/python3 temp --production --user frappe --mariadb-version 10.5 --verbose

Then it successfully Installed and I was able to access the desk.

6 Likes

Hi,

I have successfuly done step until
frappe-bench/env/bin/pip install numpy==1.18.5

However I get the error below when I frappe-bench/env/bin/pip3 install -U -e ./apps/erpnext

Defaulting to user installation because normal site-packages is not writeable
ERROR: ./apps/erpnext is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with svn+, git+, hg+, or bzr+).

Please help on how to solve
Thank you

Are you inside the frappe-bench folder? because the command ./apps/erpnext should be running inside this frappe-bench folder where you have the apps folder.
Your error is because of the path issue.

Thanks for the guide arun
I’ve made progress and now have input the final step
“sudo frappe-bench/env/bin/python3 temp --production --user frappe --mariadb-version 10.5 --verbose”

However, after enter that line, I have got the error below.
Would love your guidance again please

Thank you

@bobiskandar

From the logs it is clear that you already installed mariadb 10.2 before and now mariadb conf files are not configured properly.

I would suggest you to remove mariadb completely first from your computer.

Run the following commands for removing Mariadb :

$ sudo apt purge mariadb-server
$ sudo rm -rf /var/lib/mysql/

After removing the mariadb re run

sudo frappe-bench/env/bin/python3 temp --production --user frappe --mariadb-version 10.5 --verbose

Thanks for the swift response @Nikunj_Patel

I’ve followed the instructions and received libssl error even though I have previously already used your method to solve.
So I use the same method to fix
Line 36 : Change from - libssl1.0-dev to - libssl1.1

The I tried again to

sudo frappe-bench/env/bin/python3 temp --production --user frappe --mariadb-version 10.5 --verbose

And now face this error below
Would appreciate your help once again

Thank you

@bobiskandar

I hope you have followed following steps

  1. Fresh installation of Ubuntu 20.04
  2. Creations of user with sudo rights.
     sudo adduser *Your_USERNAME* 
     sudo usermod -aG sudo *Your_USERNAME*
  1. Use this cmd to get your install.py
wget https://raw.githubusercontent.com/frappe/bench/develop/install.py
  1. Updating the install.py in order to support Ubuntu 20.04, by default the script is made for Ubuntu <=18.04.
    By the way with ubuntu 20.04 python 3.8 comes installed. And hence the platform.dist() is no more supported by the python3.8.

To help the installation we have to do the following modifications in the install.py,

On line 81 : Change ’ ubuntu’: [14, 15, 16, 18, 19], to ‘ubuntu’: [14, 15, 16, 18, 19, 20],
On line 100 : Change current_dist = platform.dist() to current_dist = [“Ubuntu”, “20.04”]

This will get you started with installation.

  1. Always install it with --verbose on to know where the problem is occurring.

The famous “returned non-zero exit status 1” error will bother you but don’t worry --verbose will tell you why this is not working.

In my case I used following cmd : sudo python3 install.py --production --user Your_USERNAME --mariadb-version 10.5 --verbose

Note mariadb version 10.5 was used since default 10.2 is not supported by ubuntu 20.04

Lot of people is having this error but nobody was able to knows where does this error come from. Thanks to --verbose it will help troubleshooting.

In my case i had to tweak the following files to make it through.

Note : Every time the installation fails solve the error and rerun the sudo python3 install.py --production --user Your_USERNAME --mariadb-version 10.5 --verbose

Most of the errors were coming from playbooks

  1. If you get libssl error.

Since libssl1.0-dev is not supported by Ubuntu 20.04 you need to do following.

go to /tmp/ .bench/playbooks/roles/common/tasks/ubuntu.yml

sudo nano ubuntu.yml

Line 36 : Change from - libssl1.0-dev to - libssl1.1

Again libssl1.0 does not support ubuntu 20.04. Ubuntu 20.04 comes installed with libssl1.1, if not install it.

  1. If you get Nodejs error, “Error mentioning no supported version found for the distribution”

Nodejs version 12.x works with ubuntu20.04. We need to fix playbook for this.

go to /tmp/ .bench/playbooks/roles/nodejs/tasks/ debian_family.yml

sudo nano debian_family.yml

Line 6 : Change from - “curl --silent --location https://deb.nodesource.com/setup_{{ node_version }}.x | bash -”
TO “curl --silent --location https://deb.nodesource.com/setup_12.x | bash -”

Line 8 : Change from - name: Install nodejs {{ node_version }}

TO

- name: Install nodejs 12

--------------------------------------------//--------------------------------------------------------------------

go to /tmp/ .bench/playbooks/roles/nodejs/tasks/ redhat_family.yml

sudo nano redhat_family.yml

Line 6 : Change from “curl --silent --location https://rpm.nodesource.com/setup_{{ node_version }}.x | sudo bash -”
TO “curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -”

Line 8 : Change from - name: Install node v{{ node_version }}
TO - name: Install node v12

  1. If you get wkhtmltopdf error.

Then go to https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.focal_amd64.deb
download the wkhtmltox_0.12.5-1.focal_amd64.deb file rename it to wkhtmltox.deb

And the copy or move this file to /tmp folder.

I am not a professional coder so any mistakes or wrong way of doing things in above method should be highlighted and your feedback is appreciated.

  1. If you face ModuleNotFoundError: No module named ‘erpnext .

Follow this https://medium.com/@binodpaneru23/setting-up-erpnext-in-mac-os-c475466f5403

Based on this doc I used

frappe-bench/env/bin/pip3 install -U -e ./apps/erpnext

Thanks @arun992 for steps 5 and 6

  1. if you get stuck with Cython is required to compile pandas from a development branch. error.
    Check this post [https://github.com/frappe/erpnext/issues/22424 ]

Based on this doc use the following commands:

frappe-bench/env/bin/pip3 install pandas==0.24.2
frappe-bench/env/bin/pip install numpy==1.18.5

After this use

frappe-bench/env/bin/pip3 install -U -e ./apps/erpnext

Oncef inished the erpnext installationcontinue with the command

sudo frappe-bench/env/bin/python3 temp --production --user frappe --mariadb-version 10.5 --verbose

1 Like

Yes, I’ve followed it step by step exactly

Except that after

sudo nano debian_family.yml

Because I could continue to

sudo frappe-bench/env/bin/python3 temp --production --user frappe --mariadb-version 10.5 --verbose

so I did not do

sudo nano redhat_family.yml

And then I continued the rest of the steps exactly starting from wkhtmltopdf solution until the end

Does the error I’m getting possibly from that 1 step I did not follow?
Or is it a different issue?

Forgive me if I’m asking newbie questions, but my linux skills is very basic

Thank you

@bobiskandar

The error you are getting in is from mariaDB. You need to make sure that you uninstall mariadb properly remove all it corresponding files reboot the pc and then retry the installation.

@Nikunj_Patel

Just to update on what i’ve tried. So i’ve uninstalled mariadb and restart before continuing

$ sudo apt-get purge mariadb-*
$ sudo rm -rf /var/lib/mysql/
$ sudo reboot

Upon

sudo frappe-bench/env/bin/python3 temp --production --user frappe --mariadb-version 10.5 --verbose

It goes into the same problems as your initial step:

  • libssl error
  • Nodejs error
  • wkhtmltopdf error

I repeated the same steps to solve these problem the original instructions. And I

sudo frappe-bench/env/bin/python3 temp --production --user frappe --mariadb-version 10.5 --verbose

Then I am back to the same mariadb error as my previous post

Any help would be much appreciated
Thank you

Can we get a script which fixes the libssl,nodejs and wkhtmltopdf issue ?

@Savad_Ibrahim

We have merged this changes in development branch on github. If everything goes fine it will be available for production version as well.

So for the moment you have to either get your own branch and pull from it or you have manually change the files as mentioned in the post.

3 Likes

Hey @Nikunj_Patel,

I saw that the wkhtmltopdf and libssl changes were merge to devel branch of erpnext. Congratulations. Are you still working on getting the platform.dist() changes merged too?

Also, does specifying --erpnext-repo-url to bench work for you so we can install from our own branch instead of the version-12 upstream branch?

@idlethread

I have raised a pull request check the link below :slight_smile:

https://github.com/frappe/bench/pull/1017

seems it has some limitation we are trying to sort that out.

You can try to use the following install.py

2 Likes

@nikunj_Patel, I followed your steps. But when I am on step 5, then its just stuck there.
Below is the screen shot . I am on ubuntu 16
Any help? Really struggling to getup