Issue with updating requirements in bench

When running

bench update

the following error is thrown:

INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Q_QkNm/frappe/

When I try to manually run pip on the above requirements, it fails with

./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
Invalid requirement: './apps/erpnext/requirements.txt'
It looks like a path. Does it exist ?

The file indeed exists.

The full Python trace is

Updating Python libraries...
INFO:bench.utils:./env/bin/pip install --upgrade pip
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Q_QkNm/frappe/
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/update.py", line 62, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force, reset=reset)
  File "/home/frappe/.bench/bench/commands/update.py", line 82, in _update
    update_requirements(bench_path=bench_path)
  File "/home/frappe/.bench/bench/utils.py", line 410, in update_requirements
    install_requirements(pip, req_file)
  File "/home/frappe/.bench/bench/utils.py", line 446, in install_requirements
    exec_cmd("{pip} install -q -r {req_file}".format(pip=pip, req_file=req_file))
  File "/home/frappe/.bench/bench/utils.py", line 140, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q -r ./apps/erpnext/requirements.txt

The installation runs otherwise smoothly, also bench migrate and so on.

Any ideas what is wrong?

I don’t know if it can help, but just an idea in the full Python trace, you have
INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.txt as I understood it’s for bench requirements and INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt and for erpnext, you don’t have such line for frappe maybe you should run ./env/bin/pip install -q -r ./apps/frappe/requirements.txt

@Natalia,

many thanks for the tipps.
These commands work fine

./env/bin/pip install -q -r /home/frappe/.bench/requirements.txt
./env/bin/pip install -q -r ./apps/frappe/requirements.txt

But this fails:

./env/bin/pip install -q -r ./apps/erpnext/requirements.txt

The content is

frappe
unidecode

If I try to manually install

pip install frappe

It fails with You must have test.fm >= 1.0.4 installed before (GitHub - grafos-ml/frappe: Recommendations Serving Engine using python)

That was not a requirement before to my knowledge…

Any ideas are welcome…

Sorry but which error you received, when you run manually ./env/bin/pip install -q -r ./apps/erpnext/requirements.txt?
and I cannot understand why you tried to install frappe if you have it, from you first post I’ve understood that you received problem with bench update.

When I run ./env/bin/pip install -q -r ./apps/erpnext/requirements.txt, the error is

Invalid requirement: './apps/erpnext/requirements.txt'
It looks like a path. Does it exist ?

So, I have looked into the file with cat ./apps/erpnext/requirements.txt which returns

frappe
unidecode

Therefore, trying to install manually the depending packages, I ran

./env/bin/pip install frappe

This tries do load Downloading frappe-2.1.4.tar.gz (217kB) whereas in a working configuration it says Requirement already satisfied: frappe in ./apps/frappe instead…

You are right, I do have frappe (/home/frappe/frappe-bench/apps/frappe) installed. Could I then remove “frappe” from the requirements.txt file? If I do that, the update works just fine.
I have also checked and made sure that read access is granted for the file…

Could it be that there are conflicting pip packages?

Possibly conflicting package:

 https://pypi.python.org/pypi/frappe/2.1.4

Hi,
I don’t think that you should run ./env/bin/pip install frappe because as I’ve understood, you have frappe.
If you run bench update what have you received?
I have in my ./apps/erpnext/requirements.txt

frappe
unidecode

So, I don’t think that you should remove it.

bench update fails with

INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Q_QkNm/frappe/

Operating system is Debian 9 (stretch) amd64.

Does anyone know the above mentioned frappe package from pip?