No module named frappe.celery_app

@koshish How you resolved this I have the same problem

@hereabdulla please open the link below. You will find a file named celery_app.py

Download the file and save it in frappe-bench/apps/frappe/frappe

@koshish Thanks for your Reply.It worked :grinning:

Hi @koshish and @hereabdulla, that’s not the right solution for this problem. It’ll create problems next time you try to update.

First delete that file you downloaded

Try doing this, go to the bench-repo folder and then do git checkout develop, followed up git reset origin/develop --hard and then go to the frappe-bench folder and run bench setup procfile

Now try doing bench start

thanks @vjFaLk for the timely suggestion!..

Hi @vjFaLk we are facing the same issue here with a freshly installed mac. However I do not want to switch to develop branch because we prefer to develop on a stable branch. Could you provide a solution and please also update the setup instructions because this happens when installing the current frappe according to the setup.

This discussion also seems to be going on here: I can not up the application with the same proposed solution

Go to the bench-repo directory, run git checkout develop and then inside frappe-bench run bench setup procfile

But again I dont think this is a solution to the problem of how to develop locally based on your stable release?

In both the scenarios the users were using the develop branch of ERPNext. In fact, this error shouldn’t come up in the master branch. Can you make sure that your new setup has the master branches for erpnext, frappe and bench-repo?

No @vjFaLk I actually wasn’t, that is strange. I installed with the normal instructions that are given and wasn’t aware that it would set up as develop rather than master. The normal setup creates it exactly like my setup, so the normal setup breaks with the problem these users described. Maybe that should be reconsidered?

➜ bench-repo git:(master)
➜ frappe git:(develop)
➜ erpnext git:(develop)

So what do I need to do to move frappe and erpnext to master @vjFaLk ?

I want to develop on master branch.

Ah I see, you did the developer setup I believe? (without --setup-production) It comes with the develop branches. I’m unsure of the cause of people having issues with the update, but it’s mostly been smooth.

Now there’s a problem, the difference between master and develop at this point is significant, because of which there are database differences that make it a bit of a task to move back from develop to master if you’ve migrated once.

Two ways you can do this :

  1. The less-hassley way, but you have to destroy your site
  • bench switch-to-master
  • bench drop-site [current-site-name]
  • bench new-site [new-site-name]
  • bench --site [new-site-name] install-app erpnext
  • bench update
  1. More hassle, but you get to keep your site
  • bench use [your-site]
  • bench switch-to-master
  • Run bench mysql. You should get in the SQL shell
  • Run ALTER TABLE tabDocType DROP COLUMN track_seen;
  • And then run ALTER TABLE tabDocType DROP COLUMN quick_entry;
  • Exit the SQL shell, and run bench update

Thank you @vjFaLk I do not need to save my site so I will go with route 1.
I have dripped the site with bench drop-site successfully. However running bench switch-to-master throws an error:

➜  frappe-bench bench switch-to-master
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/Users/dominik/Dev/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Users/dominik/Dev/bench-repo/bench/commands/update.py", line 122, in switch_to_master
    switch_to_master(upgrade=upgrade)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 181, in switch_to_master
    switch_branch('master', apps=apps, bench=bench, upgrade=upgrade)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 152, in switch_branch
    version_upgrade = is_version_upgrade(bench=bench, branch=branch)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 99, in is_version_upgrade
    raise Exception("Current branch of 'frappe' not in upstream")
Exception: Current branch of 'frappe' not in upstream

Are you in a branch in frappe that isn’t a remote branch (develop /master)? You can just go to the folder and do git checkout master and run the command again

Not that I can see, I am basically still fresh after installing and havent done anything yet other than the setup instructions and bench update.

➜  frappe-bench cd apps/erpnext
➜  erpnext git:(develop) cd ..
➜  apps cd frappe
➜  frappe git:(develop)
➜  frappe git:(develop) git checkout master
error: pathspec 'master' did not match any file(s) known to git.

This is pretty odd.

Instead of going back and forth with commands, can I remotely help you out with this? Teamviewer maybe?

Thank you for the offer. I have sent you a PM with the credentials since I dont know your email address. Also my colleague is getting frustrated on another topic ERPnext Fresh Setup to MacOs - Common Problems that is related to this.

Alright, the issue is being caused by shallow clones of the repos. Try going in the frappe and erpnext directory and doing git fetch --unshallow and then bench switch-to-master

executed git fetch --unshallow both on apps/frappe and apps/erpnext and then went back to frappe bench to run bench switch-to-master the result does not differ:

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/Users/dominik/Dev/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Users/dominik/Dev/bench-repo/bench/commands/update.py", line 122, in switch_to_master
    switch_to_master(upgrade=upgrade)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 181, in switch_to_master
    switch_branch('master', apps=apps, bench=bench, upgrade=upgrade)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 152, in switch_branch
    version_upgrade = is_version_upgrade(bench=bench, branch=branch)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 99, in is_version_upgrade
    raise Exception("Current branch of 'frappe' not in upstream")
Exception: Current branch of 'frappe' not in upstream

So basically @anand and @vjFaLk the long and short of this is that with the manual setup instruction at the moment you can not use the master branch for some reason. The original instruction that switches the bench-repo to develop will allow a bench start, however everything (bench, frappe, erpnext) will be in develop branch.

You can always use master branch. The problem is that OSX’s git makes it very difficult to unshallow a shallow clone.

So for now use these instructions:

  1. remove your old bench which has faulty install
  2. git clone https://github.com/frappe/bench bench-repo # this will clone master branch of bench
  3. sudo pip install -e bench-repo
  4. bench init frappe-bench --frappe-branch master
  5. bench get-app erpnext https://github.com/frappe/erpnext.git --branch master

This will get you master branches and circumvent the OSX problem for the moment.

1 Like