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.

backup.py: ModuleNotFoundError: No module named 'pyln.spec'

See original GitHub issue
root@ubuntu:~# lightningd --encrypted-hsm
2021-12-04T16:51:03.763Z DEBUG   plugin-manager: started(18545) /usr/local/bin/../libexec/c-lightning/plugins/autoclean
2021-12-04T16:51:03.765Z DEBUG   plugin-manager: started(18546) /usr/local/bin/../libexec/c-lightning/plugins/bcli
2021-12-04T16:51:03.773Z DEBUG   plugin-manager: started(18547) /usr/local/bin/../libexec/c-lightning/plugins/fetchinvoice
2021-12-04T16:51:03.785Z DEBUG   plugin-manager: started(18548) /usr/local/bin/../libexec/c-lightning/plugins/funder
2021-12-04T16:51:03.792Z DEBUG   plugin-manager: started(18549) /usr/local/bin/../libexec/c-lightning/plugins/topology
2021-12-04T16:51:03.800Z DEBUG   plugin-manager: started(18550) /usr/local/bin/../libexec/c-lightning/plugins/keysend
2021-12-04T16:51:03.802Z DEBUG   plugin-manager: started(18551) /usr/local/bin/../libexec/c-lightning/plugins/offers
2021-12-04T16:51:03.818Z DEBUG   plugin-manager: started(18552) /usr/local/bin/../libexec/c-lightning/plugins/pay
2021-12-04T16:51:03.825Z DEBUG   plugin-manager: started(18553) /usr/local/bin/../libexec/c-lightning/plugins/txprepare
2021-12-04T16:51:03.834Z DEBUG   plugin-manager: started(18554) /usr/local/bin/../libexec/c-lightning/plugins/spenderp
2021-12-04T16:51:03.841Z DEBUG   plugin-manager: started(18555) /root/repos/plugins/backup/backup.py
Traceback (most recent call last):
  File "/root/repos/plugins/backup/backup.py", line 2, in <module>
    from pyln.client import Plugin
  File "/root/repos/lightning/contrib/pyln-client/pyln/client/__init__.py", line 3, in <module>
    from .gossmap import Gossmap, GossmapNode, GossmapChannel, GossmapNodeId
  File "/root/repos/lightning/contrib/pyln-client/pyln/client/gossmap.py", line 3, in <module>
    from pyln.spec.bolt7 import (channel_announcement, channel_update,
ModuleNotFoundError: No module named 'pyln.spec'
2021-12-04T16:51:04.035Z INFO    plugin-backup.py: Killing plugin: exited before replying to getmanifest

My installed versions/packages:

root@ubuntu:~# lightning-cli --version
v0.10.2
root@ubuntu:~# pip3 list | grep pyln
pyln-bolt7                    1.0.2.186
pyln-client                   0.9.3
pyln-proto                    0.10.1

I’m not sure what to do here; googling this brought up basically nothing.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SimonVrouwecommented, Dec 29, 2021

Traceback (most recent call last): File “/root/repos/plugins/backup/backup.py”, line 2, in <module> from pyln.client import Plugin File “/root/repos/lightning/contrib/pyln-client/pyln/client/init.py”, line 3, in <module> from .gossmap import Gossmap, GossmapNode, GossmapChannel, GossmapNodeId File “/root/repos/lightning/contrib/pyln-client/pyln/client/gossmap.py”, line 3, in <module> from pyln.spec.bolt7 import (channel_announcement, channel_update, ModuleNotFoundError: No module named ‘pyln.spec’

@v4w5gse65g874 I was able to reproduce your error once … but I also don’t understand it.

The requirements.txt for backup plugin shows pyln-client ~= 0.9.2, no other pyln-x.

After uninstalling all pyln-x (including bolts) with python3 -m pip uninstall and then reinstall with python3 -m pip install -r requirements.txt

Then the plugin runs fine without above error and python3 -m pip list shows only pyln-client

0reactions
chrisguidacommented, Jun 9, 2022

This was also happening to me on rebalance and summary. Do some requirements files need to be updated? Or possibly some Python wheels? Just installing the requirements files didn’t work for me:

pip install -r /usr/local/libexec/c-lightning/plugins/rebalance/requirements.txt …resulted in this:

# pip freeze
pyln-client==0.10.2.post1

a subsequent pip install -r /usr/local/libexec/c-lightning/plugins/summary/requirements.txt …resulted in this:

# pip freeze
certifi==2022.5.18.1
charset-normalizer==2.0.12
idna==3.3
packaging==21.3
pyln-client==0.10.2.post1
pyparsing==3.0.9
PySocks==1.7.1
requests==2.28.0
urllib3==1.26.9

Both plugins crashed until I ran: pip install -U pyln-proto pyln-bolt7

Not sure if pyln-proto is necessary, but pyln-bolt7 appears to be necessary, and missing from the requirements.txt files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues installing pyln-spec #3982 - GitHub
The current version of pyln-spec in PyPi requires ... the version of the requirement is correct, but the package name is not (pyln......
Read more >
ModuleNotFoundError: No module named 'pyln-client'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pyln-client' How to remove the Module.
Read more >
No module named <modulename> after pip install - Stack ...
Unfortunately, I have ModuleNotFoundError after successful install from pip. My dirs layout is pretty simple: maindir |- setup.py |- pysoft |- ...
Read more >
Bug #1820892 “Intermittent “Error starting thread ...
Intermittent "Error starting thread.: ModuleNotFoundError: No module named 'etcd3gw'" in grenade-py3 jobs since March 14. Bug #1820892 reported ...
Read more >
Simple index - piwheels
sahilpdf mopti nesterwh-py micropython-libc obj2uni 7pack sftpy pentageoserver haoqiren gitkit datasette-leaflet-freedraw ...
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