[Tutorial] How To install ERPNext V12 on windows 10 home / Pro WSL ubuntu 18.04LTS

APPLIES TO
ERPNext V12, Frappe 12 or later
Applies to windows home 10 build 18362 or higher, windows Pro, WSL ubuntu 18.04 LTS

GOAL
Install ERPNext V12 on windows home 10 WSL ubuntu 18.04 LTS.

SOLUTION
1- check your windwos 10 build number, should be >= 18362
win +R, cmd, ver

2 - install ubuntu 18.04 LTS WSL on windows10, follow steps under this page How to run Linux binaries natively in Windows 10 - NotebookCheck.net News

2- execute below command using your unix user (in my case I have created nofal user)

  • nofal@LAPTOP-5F23F7J8:~$ sudo apt-get update
  • nofal@LAPTOP-5F23F7J8:~$ sudo apt-get upgrade
  • frappe@LAPTOP-5F23F7J8:~/frappe-bench$ lsb_release -a – should get like below result
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 18.04.3 LTS
    Release: 18.04
    Codename: bionic
  • Reboot WSL
    Just open a cmd window as adminstrator and run these commands to restart it.
    net stop LxssManager
    net start LxssManager
    restart windows
    Launch ubuntu as non root user:
  • sudo mkdir -p /run/dbus
  • sudo service dbus start
  • sudo apt-get install python3-setuptools python3-minimal redis-server build-essential
  • sudo adduser frappe – can be any name mycase I have used frappe as a user
  • sudo usermod -aG sudo frappe
  • sudo su frappe
  • cd ~
  • sudo wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
  • sudo -H python3 install.py --production --site frappe.local --user frappe

This will install the ERPNEXT.

  • cd frappe-bench
  • bench update

connect using url http://localhost

Important Info:
Windows home 10 or windows Pro 10 build 18362 or higher is important,

Note that I failed many time installing ERPNext, each time I restart from an WSL ubuntu fresh (under apps & features, select ubuntu, advanced options, reset)
After windows restart, you need to start below services manually:

frappe@LAPTOP-5F23F7J8:~/frappe-bench$ sudo service dbus start
[sudo] password for frappe:

  • Starting system message bus dbus

frappe@LAPTOP-5F23F7J8:~/frappe-bench$ sudo service supervisor start

frappe@LAPTOP-5F23F7J8:~/frappe-bench$ sudo service mysql start

  • Starting MariaDB database server mysqld [ OK ]
    frappe@LAPTOP-5F23F7J8:~/frappe-bench$ sudo service nginx start
  • Starting nginx nginx [ OK ]
    frappe@LAPTOP-5F23F7J8:~/frappe-bench$ sudo service redis-server start
    Starting redis-server: redis-server.

to check supervisor status:

frappe@LAPTOP-5F23F7J8:~/frappe-bench$ sudo supervisorctl status
frappe-bench-redis:frappe-bench-redis-cache RUNNING pid 73, uptime 4:40:13
frappe-bench-redis:frappe-bench-redis-queue RUNNING pid 72, uptime 4:40:13
frappe-bench-redis:frappe-bench-redis-socketio RUNNING pid 74, uptime 4:40:13
frappe-bench-web:frappe-bench-frappe-web RUNNING pid 2984, uptime 2:00:18
frappe-bench-web:frappe-bench-node-socketio RUNNING pid 2986, uptime 2:00:18
frappe-bench-workers:frappe-bench-frappe-default-worker-0 RUNNING pid 2961, uptime 2:00:19
frappe-bench-workers:frappe-bench-frappe-long-worker-0 RUNNING pid 2962, uptime 2:00:19
frappe-bench-workers:frappe-bench-frappe-schedule RUNNING pid 2960, uptime 2:00:19
frappe-bench-workers:frappe-bench-frappe-short-worker-0 RUNNING pid 2963, uptime 2:00:19

to check all service status:

frappe@LAPTOP-5F23F7J8:~/frappe-bench$ service --status-all

[-] means not started
[+] means started

to start specific service as root or not:

frappe@LAPTOP-5F23F7J8:~/frappe-bench$ sudo service nginx start

to check

frappe@LAPTOP-5F23F7J8:~/frappe-bench$ sudo service nginx status

  • nginx is running

REFERENCES

ERPNext On Windows 10 :

How to run Linux binaries natively in Windows 10:

KEYWORDS
windows 10, WSL, ubuntu 18.04LTS, ERPNext V12

16 Likes

my os ver

I am afraid that your os is not supported, try upgrade?

2 Likes

ok i m trying to update my os thanks for your support nmani

1 Like

Yes it should work, most important thing is the windows build, check yours, read first part of my tutorial

It’s tough but doable, follow steps and update me, please open new thread for your issues faced.

Hi,

i have followed your tutorial. now my ERPNext up and running.

but i can’t access it from other PC in same network.

server ip address: 192.168.2.122

tried to connect from ip adress: 192.168.2.174

Hi,
I am sorry no idea, may be you will get some help from other community members.

Currently I am using instance locally in the same machine only.

BTW, I am interested to learn solution, so please update me how you solved once done.

thx
Nofal

1 Like

i have found the solution, i got no problem when install it on WSL 1. i can access from any other PC connected to same network. but, when installed on WSL 2, can’t access it from other PC.

solution was here

go to this comment here

2 Likes

Hi guys,

I face some error when I install the ERPNext to default site

Please advise me how do I solve it, thanks!!!

TASK [bench : Install ERPNext to default site] *************************************************************************
task path: /tmp/.bench/playbooks/roles/bench/tasks/setup_erpnext.yml:23
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c ‘echo ~root && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo /var/tmp/ansible-tmp-1575452135.2029614-247542400556600” && echo ansible-tmp-1575452135.2029614-247542400556600=“echo /var/tmp/ansible-tmp-1575452135.2029614-247542400556600” ) && sleep 0’
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-6080skpb89w_/tmpajyvef7o TO /var/tmp/ansible-tmp-1575452135.2029614-247542400556600/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c ‘setfacl -m u:erpolive:r-x /var/tmp/ansible-tmp-1575452135.2029614-247542400556600/ /var/tmp/ansible-tmp-1575452135.2029614-247542400556600/AnsiballZ_command.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘chmod u+x /var/tmp/ansible-tmp-1575452135.2029614-247542400556600/ /var/tmp/ansible-tmp-1575452135.2029614-247542400556600/AnsiballZ_command.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘chown erpolive /var/tmp/ansible-tmp-1575452135.2029614-247542400556600/ /var/tmp/ansible-tmp-1575452135.2029614-247542400556600/AnsiballZ_command.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘sudo -H -S -n -u erpolive /bin/sh -c ‘"’“‘echo BECOME-SUCCESS-sisiiybrhhittzadbknmtyanfbmudfaa ; /usr/bin/python3 /var/tmp/ansible-tmp-1575452135.2029614-247542400556600/AnsiballZ_command.py’”’“’ && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /var/tmp/ansible-tmp-1575452135.2029614-247542400556600/ > /dev/null 2>&1 && sleep 0’
fatal: [localhost]: FAILED! => {
“changed”: true,
“cmd”: [
“bench”,
“–site”,
“erpolive.local”,
“install-app”,
“erpnext”
],
“delta”: “0:00:03.273924”,
“end”: “2019-12-04 17:35:39.306340”,
“invocation”: {
“module_args”: {
“_raw_params”: “bench --site erpolive.local install-app erpnext”,
“_uses_shell”: false,
“argv”: null,
“chdir”: “/home/erpolive/frappe-bench”,
“creates”: null,
“executable”: null,
“removes”: null,
“stdin”: null,
“stdin_add_newline”: true,
“strip_empty_ends”: true,
“warn”: true
}
},
“msg”: “non-zero return code”,
“rc”: 1,
“start”: “2019-12-04 17:35:36.032416”,
“stderr”: “Traceback (most recent call last):\n File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py", line 583, in connect\n **kwargs)\n File "/usr/lib/python3.6/socket.py", line 724, in create_connection\n raise err\n File "/usr/lib/python3.6/socket.py", line 713, in create_connection\n sock.connect(sa)\nOSError: [Errno 22] Invalid argument\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main\n "main", mod_spec)\n File "/usr/lib/python3.6/runpy.py", line 85, in _run_code\n exec(code, run_globals)\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in \n main()\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main\n click.Group(commands=commands)(prog_name=‘bench’)\n File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 764, in call\n return self.main(*args, **kwargs)\n File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 717, in main\n rv = self.invoke(ctx)\n File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke\n return callback(*args, **kwargs)\n File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func\n return f(get_current_context(), *args, **kwargs)\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/commands/init.py", line 25, in _func\n ret = f(frappe._dict(ctx.obj), *args, **kwargs)\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/commands/site.py", line 173, in install_app\n _install_app(app, verbose=context.verbose)\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/installer.py", line 50, in install_app\n frappe.clear_cache()\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/init.py", line 570, in clear_cache\n frappe.cache_manager.clear_user_cache()\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/cache_manager.py", line 42, in clear_user_cache\n clear_global_cache()\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/cache_manager.py", line 48, in clear_global_cache\n clear_website_cache()\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/website/render.py", line 301, in clear_cache\n for method in frappe.get_hooks("website_clear_cache"):\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/init.py", line 946, in get_hooks\n hooks = _dict(cache().get_value("app_hooks", load_app_hooks))\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 79, in get_value\n val = generator()\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/init.py", line 920, in load_app_hooks\n for app in [app_name] if app_name else get_installed_apps(sort=True):\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/init.py", line 884, in get_installed_apps\n installed = json.loads(db.get_global("installed_apps") or "")\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/database.py", line 702, in get_global\n return self.get_default(key, user)\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/database.py", line 706, in get_default\n d = self.get_defaults(key, parent)\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/database.py", line 724, in get_defaults\n defaults = frappe.defaults.get_defaults(parent)\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/defaults.py", line 77, in get_defaults\n globald = get_defaults_for()\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/defaults.py", line 204, in get_defaults_for\n where parent = %s order by creation""", (parent,), as_dict=1)\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/database.py", line 122, in sql\n self.connect()\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/database.py", line 75, in connect\n self._conn = self.get_connection()\n File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 90, in get_connection\n local_infile = frappe.conf.local_infile)\n File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/pymysql/init.py", line 94, in Connect\n return Connection(*args, **kwargs)\n File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py", line 325, in init\n self.connect()\n File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py", line 630, in connect\n raise exc\npymysql.err.OperationalError: (2003, "Can’t connect to MySQL server on ‘localhost’ ([Errno 22] Invalid argument)")”,
“stderr_lines”: [
“Traceback (most recent call last):”,
" File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py", line 583, in connect”,
" **kwargs)“,
" File "/usr/lib/python3.6/socket.py", line 724, in create_connection”,
" raise err",
" File "/usr/lib/python3.6/socket.py", line 713, in create_connection",
" sock.connect(sa)“,
“OSError: [Errno 22] Invalid argument”,
“”,
“During handling of the above exception, another exception occurred:”,
“”,
“Traceback (most recent call last):”,
" File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main”,
" "main", mod_spec)“,
" File "/usr/lib/python3.6/runpy.py", line 85, in _run_code”,
" exec(code, run_globals)“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in ”,
" main()“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main”,
" click.Group(commands=commands)(prog_name=‘bench’)“,
" File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 764, in call”,
" return self.main(*args, **kwargs)“,
" File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 717, in main”,
" rv = self.invoke(ctx)“,
" File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke”,
" return _process_result(sub_ctx.command.invoke(sub_ctx))“,
" File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke”,
" return _process_result(sub_ctx.command.invoke(sub_ctx))“,
" File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke”,
" return ctx.invoke(self.callback, **ctx.params)“,
" File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke”,
" return callback(*args, **kwargs)“,
" File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func”,
" return f(get_current_context(), *args, **kwargs)“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/commands/init.py", line 25, in _func”,
" ret = f(frappe._dict(ctx.obj), *args, **kwargs)“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/commands/site.py", line 173, in install_app”,
" _install_app(app, verbose=context.verbose)“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/installer.py", line 50, in install_app”,
" frappe.clear_cache()“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/init.py", line 570, in clear_cache”,
" frappe.cache_manager.clear_user_cache()“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/cache_manager.py", line 42, in clear_user_cache”,
" clear_global_cache()“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/cache_manager.py", line 48, in clear_global_cache”,
" clear_website_cache()“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/website/render.py", line 301, in clear_cache”,
" for method in frappe.get_hooks("website_clear_cache"):“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/init.py", line 946, in get_hooks”,
" hooks = _dict(cache().get_value("app_hooks", load_app_hooks))“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 79, in get_value”,
" val = generator()“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/init.py", line 920, in load_app_hooks”,
" for app in [app_name] if app_name else get_installed_apps(sort=True):“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/init.py", line 884, in get_installed_apps”,
" installed = json.loads(db.get_global("installed_apps") or "")“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/database.py", line 702, in get_global”,
" return self.get_default(key, user)“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/database.py", line 706, in get_default”,
" d = self.get_defaults(key, parent)“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/database.py", line 724, in get_defaults”,
" defaults = frappe.defaults.get_defaults(parent)“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/defaults.py", line 77, in get_defaults”,
" globald = get_defaults_for()“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/defaults.py", line 204, in get_defaults_for”,
" where parent = %s order by creation""", (parent,), as_dict=1)“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/database.py", line 122, in sql”,
" self.connect()“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/database.py", line 75, in connect”,
" self._conn = self.get_connection()“,
" File "/home/erpolive/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 90, in get_connection”,
" local_infile = frappe.conf.local_infile)“,
" File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/pymysql/init.py", line 94, in Connect”,
" return Connection(*args, **kwargs)“,
" File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py", line 325, in init”,
" self.connect()“,
" File "/home/erpolive/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py", line 630, in connect”,
" raise exc",
“pymysql.err.OperationalError: (2003, "Can’t connect to MySQL server on ‘localhost’ ([Errno 22] Invalid argument)")”
],
“stdout”: “”,
“stdout_lines”:
}

PLAY RECAP *************************************************************************************************************
localhost : ok=80 changed=49 unreachable=0 failed=1 skipped=52 rescued=0 ignored=0

HI sir!
Thanks for the tutorial, but i am having trouble in step 2, in step 2 you ran first two commands with nofal while the third one with frappe user, can you explain the matter a bit?
how can i navigate to that frappe? also when I run that command i am getting this:
-bash: /frappe-bench$: No such file or directory

2- execute below command using your unix user (in my case I have created nofal user)

  • nofal@LAPTOP-5F23F7J8:~$ sudo apt-get update
  • nofal@LAPTOP-5F23F7J8:~$ sudo apt-get upgrade
  • frappe@LAPTOP-5F23F7J8:~/frappe-bench$ lsb_release -a – should get like below result

you are right, should be a command like below,

nofal@LAPTOP-5F23F7J8:/mnt/c/Users/naouf$ lsb_release -a

hey @nmami

I am getting the following error in setup, I am using Windows 10 Home with WSL & Ubuntu 18.04LTS

error :
frappe@DESKTOP-VVA1S0K:~$ sudo -H python3 install.py --production --site frappe.local --user frappe
Logs are saved under /tmp/logs/easy-install__2020-04-02__15-58.log
Checking System Compatibility…
ubuntu 18 is compatible!
Bench’s CLI needs these to be defined!
Run the following commands in shell:
export LC_ALL=C.UTF-8
frappe@DESKTOP-VVA1S0K:~$ export LC_ALL=C.UTF-8
frappe@DESKTOP-VVA1S0K:~$ sudo -H python3 install.py --production --site frappe.local --user frappe
Logs are saved under /tmp/logs/easy-install__2020-04-02__15-59.log
Checking System Compatibility…
ubuntu 18 is compatible!
curl already installed!
wget already installed!
git already installed!
Installing pip3…
pip3 installed!
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match
‘all’
Input MySQL and Frappe Administrator passwords:
Please enter mysql root password:
Re-enter mysql root password:
Please enter the default Administrator user password:
Re-enter Administrator password:
Passwords saved at ~/passwords.txt
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match
‘all’
[WARNING]: Could not find aptitude. Using apt-get instead
Traceback (most recent call last):
File “install.py”, line 437, in
install_bench(args)
File “install.py”, line 241, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 362, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’), stdout=log_stream, stderr=sys.stderr)
File “/usr/lib/python3.6/subprocess.py”, line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2.

I recommend to repear steps from the beginning and reset wsl also, yes it’s hard and time consuming, but it works on myblaptop

Unfortunately Mr. Nmami, I get the following error every time I implement the “sudo -H python3 install.py --production --site frappe.local --user frappe”. The error shows in WSL as follows:

frappe@DESKTOP-VLE6GTJ:~$ sudo -H python3 install.py --production --site frappe.local --user frappe
Logs are saved under /tmp/logs/easy-install__2020-05-22__04-33.log
Traceback (most recent call last):
File “install.py”, line 433, in
check_distribution_compatibility()
File “install.py”, line 78, in check_distribution_compatibility
dist_name, dist_version = get_distribution_info()
File “install.py”, line 100, in get_distribution_info
current_dist = platform.dist()
AttributeError: module ‘platform’ has no attribute ‘dist’

Any fixes for this, kindly?

the only way I got it working, after many hours was as sudo user frappe:

git clone GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps (bench dir)
cd bench
sudo python3 install.py --production --container --user frappe

Bench + Frappe + ERPNext has been successfully installed!

Looks the install script don’t work (anymore) out of context. It miss the configs for ansible playbook

2 Likes

Can you elaborate more on your answer? I have seen other members using your method. They clone bench directly from git, but I am not following exactly.

  1. Where should I close that git?
  2. why bench should be cloned only?
  3. Should we clone it inside “frappe-bench” directory? or inside “~/.bench/” directory.

Getting this error after running this command on WSL

  • sudo -H python3 install.py --production --site frappe.local --user frappe`’

frappe@DESKTOP-SU5EBTV:~$ sudo -H python3 install.py --production --site frappe.local --user frappe
Logs are saved under /tmp/logs/easy-install__2021-03-25__06-21.log
Checking System Compatibility…
ubuntu 18 is compatible!
curl already installed!
wget already installed!
git already installed!
pip3 already installed!
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-kcp66wm0/cryptography/
Traceback (most recent call last):
File “install.py”, line 436, in
install_prerequisites()
File “install.py”, line 143, in install_prerequisites
‘python3’: “sudo -H python3 -m pip install --upgrade setuptools cryptography ansible==2.8.5 pip”
File “install.py”, line 118, in run_os_command
returncode = subprocess.check_call(command, shell=True, stdout=log_stream, stderr=sys.stderr)
File “/usr/lib/python3.6/subprocess.py”, line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘sudo -H python3 -m pip install --upgrade setuptools cryptography ansible==2.8.5 pip’ returned non-zero exit status 1.
frappe@DESKTOP-SU5EBTV:~$ sudo -H python3 -m pip install --upgrade setuptools cryptography ansible==2.8.5 pip
Collecting setuptools
Using cached https://files.pythonhosted.org/packages/9e/d4/b99a960314121a003e9f39c61dfde01a1010bb47661e193a7722f7f32d52/setuptools-54.2.0-py3-none-any.whl
Collecting cryptography
Using cached https://files.pythonhosted.org/packages/fa/2d/2154d8cb773064570f48ec0b60258a4522490fcb115a6c7c9423482ca993/cryptography-3.4.6.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-1pqnc24w/cryptography/setup.py”, line 14, in
from setuptools_rust import RustExtension
ModuleNotFoundError: No module named ‘setuptools_rust’

        =============================DEBUG ASSISTANCE==========================
        If you are seeing an error here please try the following to
        successfully install cryptography:

        Upgrade to the latest pip and try again. This will fix errors for most
        users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
        =============================DEBUG ASSISTANCE==========================


----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-1pqnc24w/cryptography/
frappe@DESKTOP-SU5EBTV:~$ cd frappe-bench
bash: cd: frappe-bench: No such file or directory

Can someone please guide me through this?

Try sudo pip3 install cryptography

Still getting same error

frappe@VIAS:~$ sudo pip3 install cryptography
The directory ‘/home/frappe/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
The directory ‘/home/frappe/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Requirement already satisfied: cryptography in /usr/lib/python3/dist-packages
frappe@VIAS:~$ sudo -H python3 install.py --production --site app.viasupply.com --user frappe
Logs are saved under /tmp/logs/easy-install__2021-03-28__09-28.log
Checking System Compatibility…
ubuntu 18 is compatible!
curl already installed!
wget already installed!
git already installed!
pip3 already installed!
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-3tpvh3b7/cryptography/
Traceback (most recent call last):
File “install.py”, line 436, in
install_prerequisites()
File “install.py”, line 143, in install_prerequisites
‘python3’: “sudo -H python3 -m pip install --upgrade setuptools cryptography ansible==2.8.5 pip”
File “install.py”, line 118, in run_os_command
returncode = subprocess.check_call(command, shell=True, stdout=log_stream, stderr=sys.stderr)
File “/usr/lib/python3.6/subprocess.py”, line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘sudo -H python3 -m pip install --upgrade setuptools cryptography ansible==2.8.5 pip’ returned non-zero exit status 1.