Bug 395 - Latest nMigen causing ModuleNotFoundError's f28a3e65ca5ebaa5
Summary: Latest nMigen causing ModuleNotFoundError's f28a3e65ca5ebaa5
Status: RESOLVED INVALID
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Luke Kenneth Casson Leighton
URL:
Depends on:
Blocks:
 
Reported: 2020-06-20 02:28 BST by Cole Poirier
Modified: 2020-06-24 16:00 BST (History)
1 user (show)

See Also:
NLnet milestone: ---
total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0
parent task for budget allocation:
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cole Poirier 2020-06-20 02:28:01 BST
Accurate as of commit 868d49eccdd6582e4ee992f5f28a3e65ca5ebaa5

https://github.com/nmigen/nmigen/issues/407

It looks like a recent change to nmigen dependencies is causing ModuleNotFoundError's

```
Traceback (most recent call last):
  File "/home/colepoirier/src/nmigen/nmigen/_yosys.py", line 17, in <module>
    importlib_resources.files # py3.9+ stdlib
AttributeError: module 'importlib.resources' has no attribute 'files'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/colepoirier/src/nmigen/nmigen/_yosys.py", line 19, in <module>
    import importlib_resources # py3.8- shim
ModuleNotFoundError: No module named 'importlib_resources'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "decoder/pseudo/pywriter.py", line 8, in <module>
    from soc.decoder.power_pseudo import convert_to_python
  File "/home/colepoirier/src/soc/src/soc/decoder/power_pseudo.py", line 18, in <module>
    from soc.decoder.power_decoder import create_pdecode
  File "/home/colepoirier/src/soc/src/soc/decoder/power_decoder.py", line 84, in <module>
    from nmigen.cli import rtlil
  File "/home/colepoirier/src/nmigen/nmigen/cli.py", line 4, in <module>
    from .back import rtlil, cxxrtl, verilog, pysim
  File "/home/colepoirier/src/nmigen/nmigen/back/cxxrtl.py", line 1, in <module>
    from .._yosys import *
  File "/home/colepoirier/src/nmigen/nmigen/_yosys.py", line 21, in <module>
    import importlib_resources # py3.6- shim
ModuleNotFoundError: No module named 'importlib_resources'
```
Comment 1 Cole Poirier 2020-06-20 02:30:04 BST
This commit still works for calling pywriter.py 133d4f47d15af67118b00f85c18ed2ffb5d855c2
Comment 2 Luke Kenneth Casson Leighton 2020-06-24 16:00:15 BST
(In reply to Cole Poirier from comment #0)

>   File "/home/colepoirier/src/nmigen/nmigen/_yosys.py", line 21, in <module>
>     import importlib_resources # py3.6- shim
> ModuleNotFoundError: No module named 'importlib_resources'
> ```

this is because the module does not exist because it is listed in
the setup.py dependencies which you had not run.

as a new additional dependency, because you had not run "python3 setup.py
develop", that python library had not yet been installed.

when you ran develop, it called "pip3 install importlib_resources" on
discovering that the dependency was not installed.