ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Bench installation [pip-10]


#1
ASK [bench : python2 bench init for production] *******************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "init", "/home/frappe/frappe-bench", "--frappe-branch", "master"], "delta": "0:00:00.138844", "end": "2018-04-16 12:38:50.546006", "msg": "non-zero return code", "rc": 1, "start": "2018-04-16 12:38:50.407162", "stderr": "Traceback (most recent call last):\n  File \"/bin/bench\", line 6, in <module>\n    from pkg_resources import load_entry_point\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3088, in <module>\n    @_call_aside\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3072, in _call_aside\n    f(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3101, in _initialize_master_working_set\n    working_set = WorkingSet._build_master()\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 574, in _build_master\n    ws.require(__requires__)\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 892, in require\n    needed = self.resolve(parse_requirements(requirements))\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 778, in resolve\n    raise DistributionNotFound(req, requirers)\npkg_resources.DistributionNotFound: The 'GitPython==0.3.2.1' distribution was not found and is required by bench", "stderr_lines": ["Traceback (most recent call last):", "  File \"/bin/bench\", line 6, in <module>", "    from pkg_resources import load_entry_point", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3088, in <module>", "    @_call_aside", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3072, in _call_aside", "    f(*args, **kwargs)", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3101, in _initialize_master_working_set", "    working_set = WorkingSet._build_master()", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 574, in _build_master", "    ws.require(__requires__)", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 892, in require", "    needed = self.resolve(parse_requirements(requirements))", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 778, in resolve", "    raise DistributionNotFound(req, requirers)", "pkg_resources.DistributionNotFound: The 'GitPython==0.3.2.1' distribution was not found and is required by bench"], "stdout": "", "stdout_lines": []}
	to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost                  : ok=64   changed=6    unreachable=0    failed=1   

Traceback (most recent call last):
  File "install.py", line 396, in <module>
    install_bench(args)
  File "install.py", line 113, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 329, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
  File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

#2

check this topic Error when run "sudo bench setup production frappe" for set to production mode


#3

@codingCoffee @Bassam_Mamdouh
Step 1:

sudo python install.py --production --user frappe2

fatal: [localhost]: FAILED! => {“changed”: false, “cmd”: “/bin/pip2 install -e /home/frappe2/.bench”, “msg”: “stdout: Obtaining file:///home/frappe2/.bench\n Complete output from command python setup.py egg_info:\n Traceback (most recent call last):\n File “”, line 1, in \n File “/home/frappe2/.bench/setup.py”, line 2, in \n from pip.req import parse_requirements\n ImportError: No module named req\n \n ----------------------------------------\n\n:stderr: Command “python setup.py egg_info” failed with error code 1 in /home/frappe2/.bench/\n”}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry

Step 2:
when I noticed I have pip version 10 but still using pip 9. then i checked setup.py file.*
i found:

from setuptools import setup, find_packages
from pip.req import parse_requirements
import re, ast

Step 3:
then i replaced https://github.com/frappe/bench/blob/master/setup.py file to /home/frappe2/.bench/setup.py

Step 4:
execute following command again.
sudo python install.py --production --user frappe2
got this error.

TASK [bench : python2 bench init for production] *******************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "init", "/home/frappe2/frappe-bench", "--frappe-branch", "master"], "delta": "0:00:00.139775", "end": "2018-04-17 05:18:42.803570", "msg": "non-zero return code", "rc": 1, "start": "2018-04-17 05:18:42.663795", "stderr": "Traceback (most recent call last):\n  File \"/bin/bench\", line 6, in <module>\n    from pkg_resources import load_entry_point\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3088, in <module>\n    @_call_aside\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3072, in _call_aside\n    f(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3101, in _initialize_master_working_set\n    working_set = WorkingSet._build_master()\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 574, in _build_master\n    ws.require(__requires__)\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 892, in require\n    needed = self.resolve(parse_requirements(requirements))\n  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 778, in resolve\n    raise DistributionNotFound(req, requirers)\npkg_resources.DistributionNotFound: The 'GitPython==0.3.2.1' distribution was not found and is required by bench", "stderr_lines": ["Traceback (most recent call last):", "  File \"/bin/bench\", line 6, in <module>", "    from pkg_resources import load_entry_point", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3088, in <module>", "    @_call_aside", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3072, in _call_aside", "    f(*args, **kwargs)", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 3101, in _initialize_master_working_set", "    working_set = WorkingSet._build_master()", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 574, in _build_master", "    ws.require(__requires__)", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 892, in require", "    needed = self.resolve(parse_requirements(requirements))", "  File \"/usr/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 778, in resolve", "    raise DistributionNotFound(req, requirers)", "pkg_resources.DistributionNotFound: The 'GitPython==0.3.2.1' distribution was not found and is required by bench"], "stdout": "", "stdout_lines": []}
	to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost                  : ok=64   changed=6    unreachable=0    failed=1   

Traceback (most recent call last):
  File "install.py", line 396, in <module>
    install_bench(args)
  File "install.py", line 113, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 329, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
  File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe2']' returned non-zero exit status 2

Bench install on Easy setup failing - NO pip.req
#4

Try executing the following from the frappe-bench folder:
./env/bin/pip install GitPython==0.3.2.1
It seems like this is the command which is failing,


#5

i am really frustrated installing erpnext, i reset my server, and cannot go pass this point, same error here, tried first easy script not working with lot of errors, now tried manual way, and stuck at this error, don’t know what to do please help
Thank you


#6

i tried ./env/bin/pip install GitPython==0.3.2.1
and it is giving me bash: ./env/bin/pip: No such file or directory
please help


#7

Hello @a.elhaidary.

Can you post your error so others can have a clear context?

Regards,

Ivan


#8

Same error as bhavikpatel7023
https://discuss.erpnext.com/u/bhavikpatel7023, i tried on ubuntu 14.04
and 16.04 ( both fresh install) and they both give me same error


#9

Did you use easy_install?


#10

gettingg error when easy install

seems like duplicate entry issue

Error: self.db_insert()", " File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 314, in db_insert", " raise frappe.DuplicateEntryError(self.doctype, self.name, e)", “frappe.exceptions.DuplicateEntryError: (‘Module Def’, ‘Accounts’, IntegrityError(1062, “Duplicate entry ‘Accounts’ for key ‘PRIMARY’”))”], “stdout”: “\nInstalling erpnext…”, “stdout_lines”: ["", “Installing erpnext…”]}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry


#11

Please all git folder, frappe bench, frappe repo folder. Try to use easy installation with New user and choose production.


#12

i tried but still the same error and no installation is made


#13

well, i tried so many times installation, and it didn’t work untill i used the git manual setup guide, and i worked out and reinstalled erpnext and restored my work, and everything is working again

the link of the guide that worked out for me