Create new app failed with error Command "python setup.py egg_info" failed with error code 1

Hi,

I am trying to create new app using bench new-app custom_app command. But failed with following error.

Command “python setup.py egg_info” failed with error code 1 in /home/pirate/frappe-bench/apps/custom_app/
Traceback (most recent call last):
File “/home/pirate/.local/bin/bench”, line 9, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/pirate/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/home/pirate/.local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/pirate/.local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/pirate/.local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/pirate/.local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/pirate/.local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/pirate/bench-repo/bench/commands/make.py”, line 48, in new_app
new_app(app_name)
File “/home/pirate/bench-repo/bench/app.py”, line 156, in new_app
install_app(app, bench_path=bench_path)
File “/home/pirate/bench-repo/bench/app.py”, line 167, in install_app
find_links=find_links))
File “/home/pirate/bench-repo/bench/utils.py”, line 153, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q -e ./apps/custom_app --no-cache-dir

But bench get-app command works properly.

I also updated bench also.

Can you share the full command and trace?

Did something change in the frappe source code?
Someone also posted here that there were problems on creating a new app after running bench update twice.

Removed frappe-bench. Then reinstalled. Now able to create app. But still no idea why was not able to create app in first place.

User shared that it might have something to do with:

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

yah i also have the some problem when i make new app…
after make new app, i open the setup.py inside my app folder. i change this line

install_requires = f.read().strip().split(’
')

to

install_requires = f.read().strip().split(‘\n’)

and i copy paste and run this line at my cmd
./env/bin/pip install -q -e ./apps/custom_app --no-cache-dir

then the apps works normally for me…

i thought the \n at .split(“\n”) treated as enter when make new app

1 Like

After running the command at my Terminal i got the error below;

./apps/custom_app should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+

Any Idea why?

Thank You.

You should try a git init in your app directory ./apps/custom_app

Later you could add an origin with git to upload it in your server repository like github or gitlab or any other server.

Seriously i dont understand this. I am kinda new here.

Can you give a Step by Step guide on how to do this Please i would really Appreciate

cd ./apps/custom_app
git init
cd ../..
./env/bin/pip install -q -e ./apps/custom_app --no-cache-dir

custom_app must be the directory of your app

I didn’t test theses commands already.

i followed the steps and still i cant create a new app successful and even the last one i am trying to create is not working. Same error

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

Any idea please.

please copy paste your full log.

bench new-app crook
INFO:bench.app:creating new app crook
App Title (default: Crook): Crook
App Description: An App that can Capture Customer Information
App Publisher: frappe
App Email: mcrossbreed@gmail.com
App Icon (default ‘octicon octicon-file-directory’):
App Color (default ‘grey’): blue
App License (default ‘MIT’): MIT
‘crook’ created at /home/frappe/frappe-bench/apps/crook
INFO:bench.app:installing crook
INFO:bench.utils:./env/bin/pip install -q -e ./apps/crook --no-cache-dir
Command “python setup.py egg_info” failed with error code 1 in /home/frappe/frappe-bench/apps/crook/
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/crook --no-cache-dir

Can you share your pip version?

@kolotayo

i solved this 1 by :

i open file setup.py inside your new app module
i saw this code not correct
step 1

i fixed the code to :
step 2

after that, i copy this ./env/bin/pip install -q -e ./apps/crook --no-cache-dir
to my ssh at frappe-bench folder and enter

after that i put the new module name inside
/home/frappe/frappe-bench/sites/apps.txt

step 4

and i install the module to the site i want to install it… install like usual with bench --site [sitename] install-app [appname]
and its work for me

3 Likes

This works very fine for me and i can see my app.
But will i have to always do this each time i am creating a new app?

I just tried to create a new-app now and i got the same error after going through the process it worked again

Any Idea Please?

1 Like

I think the newest update should fix it.
Try running bench update and creating a new app to check if the problem has been solved.