Bench and Pip version configuration

We had cloned the bench repo and executed command

bench init frappe1

We are facing Issue:

File “/ERPNext/xyz/dev/bench_repo/bench/utils.py”, line 106, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: frappe1/env/bin/pip install -q -e frappe1/apps/frappe

To get the exact root cause of the failure we ran below command
$ frappe1/env/bin/pip install -v -q -e frappe1/apps/frappe

Obtaining file:///ERPNext/xyz/dev/frappe1/apps/frappe
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/ERPNext/xyz/dev/frappe1/apps/frappe/setup.py”, line 2, in
from pip.req import parse_requirements
ImportError: No module named req

From above stacktrace it is clear that bench uses pip from the env/bin directory.

By reading at pip documentation we found that after pip version 10 they had changed the pip.req to pip._internal.req

Bench init command by default installs latest pip version which is 18 at present.
$ frappe1/env/bin/pip --version

pip 18.0 from /ERPNext/xyz/dev/frappe1/env/lib/python2.7/site-packages/pip (python 2.7)

Global PIP version installed on my machine is 9.0.3
$ pip --version

pip 9.0.3 from /usr/lib/python2.7/site-packages (python 2.7)

Can we configure bench to use globally installed pip?

The install script should install the version of pip that we support. It should be locked down so it does not install the latest version.

cc @codingCoffee

1 Like

Since we have planned schedule to move application to Production environment, can you suggest some workaround for now.

Hardware config:-
Environment/ Platform: AWS dedicated cloud instance
OS: CentOS 7
RAM: 8GB
HDD: 50GB

Can you try with the install script?

PS: it is best to do this on a blank server as mentioned in the installation steps.

Hello,

This is our second ERP application, which we are deploying and facing the issue.

We have follow all the necessary steps while deploying.
First application is running smoothly, let us know any workaround.

This issues has been fixed in the our repo. Are you using using your own fork of frappe/erpnext to install from? If not can you post the exact steps from the beginning to have this error replicated?

Thanks for suggestion.

We refer latest frappe codebase to fix the issue.

We have write condition just after Pip install, to upgrade install pip 9.0.3.