Hi,
Recently we made some changes in installation/upgrade flow of requirements, to avoid conflicts for the dependencies in requirements.txt.
Ref PR:
- fix: install app instead of requirements.txt by codingCoffee · Pull Request #744 · frappe/bench · GitHub
- fix: pull app list from sites/apps.txt by saurabh6790 · Pull Request #761 · frappe/bench · GitHub
If you have a custom app installed on your frappe-bench, then you may come across the
error while doing bench update
or bench setup requirements
eg:
INFO:bench.utils:./env/bin/pip install -q -e ./apps/dropbox_erpnext_broker
Command "python setup.py egg_info" failed with error code 1 in /Users/saurabh/project/frappe-bench/apps/dropbox_erpnext_broker/
Traceback (most recent call last):
File "/usr/local/bin/bench", line 11, in <module>
load_entry_point('bench', 'console_scripts', 'bench')()
File "/Users/saurabh/bench-repo/bench/cli.py", line 40, in cli
bench_command()
File "/Users/saurabh/Library/Python/2.7/lib/python/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Users/saurabh/Library/Python/2.7/lib/python/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/saurabh/Library/Python/2.7/lib/python/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/saurabh/Library/Python/2.7/lib/python/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/saurabh/Library/Python/2.7/lib/python/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/saurabh/Library/Python/2.7/lib/python/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Users/saurabh/bench-repo/bench/commands/setup.py", line 161, in setup_requirements
setup_python_requirements()
File "/Users/saurabh/bench-repo/bench/commands/setup.py", line 167, in setup_python_requirements
update_requirements()
File "/Users/saurabh/bench-repo/bench/utils.py", line 442, in update_requirements
install_app(app, bench_path=bench_path)
File "/Users/saurabh/bench-repo/bench/app.py", line 179, in install_app
find_links=find_links))
File "/Users/saurabh/bench-repo/bench/utils.py", line 159, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q -e ./apps/dropbox_erpnext_broker
Steps to resolve the issue
- Run
./env/bin/pip install -e ./apps/[app_name]
to identify the actual issue
➜ frappe-bench ./env/bin/pip install -e ./apps/dropbox_erpnext_broker
Obtaining file:///Users/saurabh/project/frappe-bench/apps/dropbox_erpnext_broker
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/saurabh/project/frappe-bench/apps/dropbox_erpnext_broker/setup.py", line 3, in <module>
from pip.req import parse_requirements
ImportError: No module named req
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /Users/saurabh/project/frappe-bench/apps/dropbox_erpnext_broker/
-
open setup.py for that particular app
-
remove Ln No: 3 from setu.py
from pip.req import parse_requirements
- -
Replace code on line no 14
old code:
requirements = parse_requirements("requirements.txt", session="")
new code:
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
-
Then in setup function remove kwarg
dependency_links
and updateinstall_requires=install_requires
-
save the file
Now again run bench update
or bench setup requirements
where you left…