Error while creating new custom app

Hi Friends,
We are getting this error while creating new custom app.

command: $ bench new-app wit_education_app

INFO:bench.app:creating new app wit_education_app
App Title (default: Wit Education App):
App Description: WIT Education Customizations
App Publisher: WIT
App Email: name@wit.edu.sa
App Icon (default ‘octicon octicon-file-directory’):
App Color (default ‘grey’): orange
App License (default ‘MIT’):
‘wit_education_app’ created at /home/frappe/frappe-bench/apps/wit_education_app
INFO:bench.app:installing wit_education_app
INFO:bench.utils:./env/bin/pip install -q -e ./apps/wit_education_app --no-cache-dir
Command “python setup.py egg_info” failed with error code 1 in /home/frappe/frappe-bench/apps/wit_education_app/
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
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/make.py”, line 48, in new_app
new_app(app_name)
File “/home/frappe/.bench/bench/app.py”, line 156, in new_app
install_app(app, bench_path=bench_path)
File “/home/frappe/.bench/bench/app.py”, line 167, in install_app
find_links=find_links))
File “/home/frappe/.bench/bench/utils.py”, line 153, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q -e ./apps/wit_education_app --no-cache-dir

Please help.

If i run below command it is still giving error
./env/bin/pip install -q -e ./apps/wit_education_app

Command “python setup.py egg_info” failed with error code 1 in /home/frappe/frappe-bench/apps/wit_education_app/

Sorry for the issue.

We able to replicate the issue and fixing via escape new line char while creating boilerplate for app by saurabh6790 · Pull Request #5533 · frappe/frappe · GitHub

Thanks for your response,
Actually i am not getting what steps to take.
Do this mean that i have to change some things in setup.py of the app?
my setup.py file is like this:

from setuptools import setup, find_packages
import re, ast

with open(‘requirements.txt’) as f:
install_requires = f.read().strip().split(’
')

_version_re = re.compile(r’version\s+=\s+(.*)')

with open(‘wit_education_app/init.py’, ‘rb’) as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode(‘utf-8’)).group(1)))

setup(
name=‘wit_education_app’,
version=version,
description=‘WIT Education Customizations’,
author=‘WIT’,
author_email=‘mtajammul@wit.edu.sa’,
packages=find_packages(),
zip_safe=False,
include_package_data=True,
install_requires=install_requires
)

Wait for the changes to be merge and then run an update using bench update.

This would be the best way moving forward.

Got you :+1:

What is expected merge time?

No definite merge. Could get merged today itself. Just follow the PR sent.

should be

install_requires = f.read().strip().split('\n')

Merged a fix. Please pull latest updates.

Thanks for updating. I think its only merged with development branch.

I have same issue while creating new app. I have latest version of ERPNext and Frappe

I have resolved this error by just run bench setup requirements command. Thanks @rohit_w .

1 Like