ImportError with module

I have managed to restore a working database in my localhost. But I’ve discovered that a module existing in the production server, doesn’t exists in my localhost and I get an ImportError “No module named pick-and-place”

I tried
pip install -q -e pick-and-place
but I got
pick-and-place should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+

How can I resolve this issue?

Sorry if I have got your post wrong,
In saying a module called “pick-and-place” is missing do you mean a custom frappe/erpnext module that was present on your production server?
If so then download your production DB and your custom module folder/files to your new local server.

Thank you for the response @System19.
Actually the pick-and-place is a custom app created on production server. I have created a local database instance of the production database from a recent backup file but when I run the bench start gives me that imprortError informing that this app is missing.
Then I tried to get the app with

bench get-app pick-and-place <git-repo>

and install it but still gives me the same error “No module named pick-and-place”. Any help appreciated!

your app name should use underscores. So it should be pick_and_place

Hi @anand
Unfortunately the same error comes

➜  frappe-bench bench get-app pick_and_place https://github.com/newmatik/Pick-and-Place.git

INFO:bench.app:getting app pick_and_place
Cloning into ‘pick_and_place’…
remote: Counting objects: 26, done.
Unpacking objects: 100% (26/26), done.
remote: Total 26 (delta 0), reused 0 (delta 0), pack-reused 26
Checking connectivity… done.
installing pick_and_place
INFO:bench.app:installing pick_and_place
Traceback (most recent call last):
File “/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/Users/makis/Dev/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/Users/makis/Dev/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/Users/makis/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 664, in call
return self.main(*args, **kwargs)
File “/Users/makis/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 644, in main
rv = self.invoke(ctx)
File “/Users/makis/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Users/makis/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Users/makis/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/Users/makis/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
return callback(*args, **kwargs)
File “/Users/makis/Dev/frappe-bench/apps/frappe/frappe/commands.py”, line 246, in build
frappe.init(‘’)
File “/Users/makis/Dev/frappe-bench/apps/frappe/frappe/init.py”, line 140, in init
setup_module_map()
File “/Users/makis/Dev/frappe-bench/apps/frappe/frappe/init.py”, line 740, in setup_module_map
for module in get_module_list(app):
File “/Users/makis/Dev/frappe-bench/apps/frappe/frappe/init.py”, line 640, in get_module_list
return get_file_items(os.path.join(os.path.dirname(get_module(app_name).file), “modules.txt”))
File “/Users/makis/Dev/frappe-bench/apps/frappe/frappe/init.py”, line 598, in get_module
return importlib.import_module(modulename)
File “/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
ImportError: No module named pick-and-place
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
File “/Users/makis/Dev/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 664, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 644, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
return callback(*args, **kwargs)
File “/Users/makis/Dev/bench-repo/bench/cli.py”, line 175, in get_app
_get_app(name, git_url, branch=branch)
File “/Users/makis/Dev/bench-repo/bench/app.py”, line 56, in get_app
build_assets(bench=bench)
File “/Users/makis/Dev/bench-repo/bench/utils.py”, line 171, in build_assets
run_frappe_cmd(‘build’, bench=bench)
File “/Users/makis/Dev/bench-repo/bench/utils.py”, line 496, in run_frappe_cmd
raise CommandFailedError(args)
bench.utils.CommandFailedError: (‘build’,)

With your cloned DB in place:
FTP your custom app folder down to your local server and place it in the same location as it sits on your production server.
You also need to DL the

frappe-bench/sites/

folder from your production server then:

bench start

Occasionally you may encounter file permission issues with your downloaded folders/files. FileZilla allows you to change these easily.
Depending on how the app was coded you may also need to FTP down:

frappe-bench/apps/erpnext/hooks.py
frappe-bench/apps/erpnext/fixtures/

HTH

Check sites/apps.txt folder and make sure it has pick_and_place and not pick-and-place

shows a 404 error (as well as pick_and_place). Could that be your problem or is that a hidden/private repository?

Issue resolved with @anand recomantation. I also deleted the folders under frappe-bench/apps/, got the app and installed it again.
Thank you all for the responses.