ImportError: No module named erpnext_shopify

Hi friends
Las ERPnext crashed due to some problems, I installed a new one, now I want to restore my database, when I run bench --site site_name migrate
it shows me this error ImportError: No module named erpnext_shopify

the previous erpnext were connected to shopify by private app.
now I don’t know what to do please help me.

You may try this
bench get-app erpnext_shopify https://github.com/frappe/erpnext_shopify
and then migrate again

1 Like

dear @lukptr thank you for replying me
after running the command gives me this error

frappe@MMERP1:~/frappe-bench$ bench get-app erpnext_shopify https://github.com/frappe/erpnext_shopify
INFO:bench.app:getting app erpnext_shopify
INFO:bench.utils:git clone https://github.com/frappe/erpnext_shopify  --depth 1 --origin upstream
Cloning into 'erpnext_shopify'...
remote: Counting objects: 123, done.
remote: Compressing objects: 100% (105/105), done.
remote: Total 123 (delta 13), reused 63 (delta 0), pack-reused 0
Receiving objects: 100% (123/123), 1.13 MiB | 222.00 KiB/s, done.
Resolving deltas: 100% (13/13), done.
Checking connectivity... done.
('installing', u'erpnext_shopify')
INFO:bench.app:installing erpnext_shopify
INFO:bench.utils:./env/bin/pip install -q  -e ./apps/erpnext_shopify --no-cache-dir
Command "python setup.py egg_info" failed with error code 1 in /home/frappe/frappe-bench/apps/erpnext_shopi                                   fy/
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    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 38, in get_app
    get_app(git_url, branch=branch)
  File "/home/frappe/.bench/bench/app.py", line 106, in get_app
    install_app(app=app_name, bench_path=bench_path, verbose=verbose)
  File "/home/frappe/.bench/bench/app.py", line 137, in install_app
    find_links=find_links))
  File "/home/frappe/.bench/bench/utils.py", line 145, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q  -e ./apps/erpnext_shopify --no-cache-dir

sorry the first error was not true

Hi,

  1. Check that the repo for erpnext_shopify is updated by going into that directory and executing git status

  2. Make sure you have run this command:

    bench --site [your site name] install-app erpnext-shopify

  3. Try migrating again.

1 Like

thank you @snv to reply me

erpnext_shopify is up-to-dat


frappe@MMERP1:~/frappe-bench/apps/erpnext_shopify$ git status
On branch develop
Your branch is up-to-date with 'upstream/develop'.
nothing to commit, working directory clean

and off course I first I run bench --site [your site name] install-app erpnext-shopify and then migrate

dear snv it seams that I can’t clone erpnext_shopfy
when I run bench --site [your site name] install-app erpnext-shopify it shows
Could not find app "erpnext-shopify"

How about you try to remove the app directory (rm -R directory_name) and try downloading and installing again?

1 Like

you mean erpnext_shopify dir?
let me try

1 Like

no success still having the same problem

frappe@MMERP1:~/frappe-bench$ bench get-app erpnext_shopify https://github.com/frappe/erpnext_shopify
INFO:bench.app:getting app erpnext_shopify
INFO:bench.utils:git clone https://github.com/frappe/erpnext_shopify  --depth 1 --origin upstream
Cloning into 'erpnext_shopify'...
remote: Counting objects: 123, done.
remote: Compressing objects: 100% (105/105), done.
remote: Total 123 (delta 13), reused 63 (delta 0), pack-reused 0
Receiving objects: 100% (123/123), 1.13 MiB | 350.00 KiB/s, done.
Resolving deltas: 100% (13/13), done.
Checking connectivity... done.
('installing', u'erpnext_shopify')
INFO:bench.app:installing erpnext_shopify
INFO:bench.utils:./env/bin/pip install -q  -e ./apps/erpnext_shopify --no-cache-dir
Command "python setup.py egg_info" failed with error code 1 in /home/frappe/frappe-bench/apps/erpnext_shopify/
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    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 38, in get_app
    get_app(git_url, branch=branch)
  File "/home/frappe/.bench/bench/app.py", line 106, in get_app
    install_app(app=app_name, bench_path=bench_path, verbose=verbose)
  File "/home/frappe/.bench/bench/app.py", line 137, in install_app
    find_links=find_links))
  File "/home/frappe/.bench/bench/utils.py", line 145, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q  -e ./apps/erpnext_shopify --no-cache-dir

Please help someone

it is probably because you downloaded erpnext_shopify but you are trying to install erpnext-shopify

Notice the change from _ (underscore) to - (hyphen) in app name

Use the same name in both get-app and install-app steps

2 Likes

ok let me try

the command bench get-app erpnext_shopify https://github.com/frappe/erpnext_shopify
worked on ERPNext which I installed manually

but not working on erpnext which I installed using script

Did you run this command later

bench --site [your site name here] install-app erpnext_shopify

I have no idea about this. But try the above command on the manually installed ERPnext

1 Like

IT worked for manual

erpnext_shopify installed successfully
command bench --site site_name --force restore database.sql run successfully

but when I run bench --site site_name migrate I get this error


_**Unknown column 'reference_doctype'**_

Executing erpnext.patches.v11_0.rename_supplier_type_to_supplier_group in erp.nawrooz.com (71c20db6c21e4ba7)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
    main()
  File "/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/bench/erpnext/apps/frappe/frappe/commands/__init__.py", line 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/opt/bench/erpnext/apps/frappe/frappe/commands/site.py", line 222, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/opt/bench/erpnext/apps/frappe/frappe/migrate.py", line 39, in migrate
    frappe.modules.patch_handler.run_all()
  File "/opt/bench/erpnext/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/opt/bench/erpnext/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/opt/bench/erpnext/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/opt/bench/erpnext/apps/erpnext/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py", line 11, in execut                                                                                                                 e
    rename_doc("DocType", "Supplier Type", "Supplier Group", force=True)
  File "/opt/bench/erpnext/apps/frappe/frappe/model/rename_doc.py", line 47, in rename_doc
    update_link_field_values(link_fields, old, new, doctype)
  File "/opt/bench/erpnext/apps/frappe/frappe/model/rename_doc.py", line 219, in update_link_field_values
    (new, old))
  File "/opt/bench/erpnext/apps/frappe/frappe/database.py", line 199, in sql
    self._cursor.execute(query, values)
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 170, in execute
    result = self._query(query)
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 328, in _query
    conn.query(q)
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 516, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 727, in _read_query_result
    result.read()
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1066, in read
    first_packet = self.connection._read_packet()
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 683, in _read_packet
    packet.check_error()
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/protocol.py", line 220, in check_error
    err.raise_mysql_exception(self._data)
  File "/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.InternalError: (1054, u"Unknown column 'reference_doctype' in 'where clause'")

@Zia_Akbari what happens if you switch to master and then migrate

1 Like

You mean master = root user in ubuntu?
sorry I couldn’t understand

What does git status say ? I mean go to erpnext_shopify and run git status

1 Like

@root13F sahib thanks for replying
shopify problem solved
I’m having another error
Unknown column 'reference_doctype' in 'where clause' when I migrate