question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: No module named decoders

See original GitHub issue

Since last big commit moving protocol files into versions, I can’t use it programmatically anymore. I tried using the pip module as well.

I tried sc2_cli.py and it works no problem but however when I do the basic example in the tutorial documentation

import mpyq

# Using mpyq, load the replay file.
archive = mpyq.MPQArchive('test.SC2Replay')
contents = archive.header['user_data_header']['content']

# Now parse the header information.
from s2protocol import versions
header = versions.latest().decode_replay_header(contents)

Full trace

$ python tester.py
Traceback (most recent call last):
  File "tester.py", line 15, in <module>
    header = versions.latest().decode_replay_header(contents)
  File "/Users/Florian/gitworkspace/s2protocol/s2protocol/versions/__init__.py", line 62, in latest
    return _import_protocol(base_path, module_name)
  File "/Users/Florian/gitworkspace/s2protocol/s2protocol/versions/__init__.py", line 27, in _import_protocol
    return imp.load_module(protocol_module_name, fp, pathname, description)
  File "/Users/Florian/gitworkspace/s2protocol/s2protocol/versions/protocol58400.py", line 21, in <module>
    from decoders import *
ImportError: No module named decoders

I tried putting from s2protocol.decoders import * instead of from decoders import * and I didn’t get the error so probably something you’d want to modify in the autogeneration

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jreppcommented, Oct 19, 2017

Yeah this is a known issue that I’m very close to sorting out. It has to do with how the autogen modules import the core decoders. I tried putting work arounds in the python loading code but I haven’t gotten that to work satisfactorily. I’ve redone the auto-code gen (versions/protocolxxxxx.py) which should be rolling out over the next day or two.

0reactions
jreppcommented, Oct 27, 2017

Merged in #61 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

1684 – ImportError: No module named '_ctypes'
Bug 1684 - ImportError: No module named '_ctypes' ... srd: ImportError: Failed to load decoder ir_irmp: import by name failed: No module ...
Read more >
Python import Error: from .decoder import JSONDecoder ...
I have a python module (getActiveLocation.py). It basically makes a http POST call, processes its response and returns it. It makes use of...
Read more >
Re: [sigrok-devel] Nightly PulseView AppImage on Ubuntu ...
Re: [sigrok-devel] Nightly PulseView AppImage on Ubuntu starts but shows a python traceback: No module named _ctypes.
Read more >
ImportError: No module named pyasn1.codec.der? [SOLVED]
I ran python script on my windows and I got this error below ,how can I fix it? I'm using python 2.7.3 from...
Read more >
Fix: ImportError No Module Named in Python
As you can see in the above line of code, we are trying to import scrapy library, but it is giving us the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found