weechat-matrix icon indicating copy to clipboard operation
weechat-matrix copied to clipboard

Module not found: 'logbook'

Open namebee opened this issue 5 years ago • 16 comments

ModuleNotFoundError: No module named 'logbook'

This is my first time using Weechat, I'm on Python 3.8.3 and I have all requirements installed. No clue why this isn't working.

I'll gladly give more info, I'm not sure what info you guys need though.

Edit: I've checked now that this happens for all modules, Not just logbook.

namebee avatar Jul 13 '20 09:07 namebee

Are you sure that all requirements are installed? It's complaining that it can't find logbook which is listed as a requirement.

poljar avatar Jul 13 '20 09:07 poljar

Yes, Everything is installed. If I comment out import logbook it complains about OpenSSL not being there.

Screenshot 2020-07-13 at 11 30 18 AM

namebee avatar Jul 13 '20 09:07 namebee

Maybe you have installed the dependencies for a different Python installation from the one used in WeeChat? Try to run these commands in Weechat to check:

/python eval import sys; print(sys.path)
/plugin listfull python

trygveaa avatar Jul 15 '20 10:07 trygveaa

How to fix this?

/python eval import sys; print(sys.path) gives:

 ['/Users/myaccount/.local/share/weechat/python', '/usr/local/Cellar/weechat/3.3_1/share/weechat/python', '',
         │             | '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.10/lib/python310.zip',
         │             | '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.10/lib/python3.10',
         │             | '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload',
         │             | '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages']

and /plugin listfull python gives:

         │00:00:43     | 
         │00:00:43     |   python [v3.3]: Support of python scripts (/usr/local/Cellar/weechat/3.3_1/lib/weechat/plugins/python.so)
         │00:00:43     |   written by "Sébastien Helleu <[email protected]>", license: GPL3
         │00:00:43     |     commands hooked:
         │00:00:43     |       /python (list/load/unload scripts)
         │00:00:43     |     signals hooked:
         │00:00:43     |       signal: debug_dump
         │00:00:43     |       signal: debug_libs
         │00:00:43     |       signal: python_script_install
         │00:00:43     |       signal: python_script_remove
         │00:00:43     |       signal: python_script_autoload
         │00:00:43     |     completions hooked:
         │00:00:43     |         python_script

mesozoic-technology avatar Dec 17 '21 05:12 mesozoic-technology

@realisation: Have you run pip install -r requirements.txt? If so, what does pip list -v output?

trygveaa avatar Dec 18 '21 00:12 trygveaa

Same issue all dependencies installed

bimawa avatar Dec 22 '21 21:12 bimawa

CleanShot 2021-12-23 at 02 17 00 CleanShot 2021-12-23 at 02 19 41

bimawa avatar Dec 22 '21 21:12 bimawa

@realisation: Have you run pip install -r requirements.txt? If so, what does pip list -v output?

I made a gist to show the output since its fairly verbose -

https://gist.github.com/realisation/ee4558615347e0d867c9e7d3f37358cb

mesozoic-technology avatar Dec 24 '21 19:12 mesozoic-technology

@realisation: So WeeChat is using the Python install in /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.10, but pip is using the one in /usr/local/anaconda3/lib/python3.8. You have to either install the packages in /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.10 (you could try using /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.10/bin/pip), use a virtualenv, or run WeeChat against the Python in /usr/local/anaconda3/lib/python3.8.

@bimawa: You likely have a similar issue. Make sure you have installed the dependencies in the Python installation that WeeChat is using. You can check which Python installation WeeChat uses with /python eval import sys; print(sys.path).

trygveaa avatar Dec 25 '21 11:12 trygveaa

@trygveaa Yes its helped! /python eval import sys; print(sys.path): return /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.10/lib/python3.10 I did /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.10/bin/pip3.10 install -r requirements.txt after /script load matrix.py I got new issue :(

CleanShot 2021-12-25 at 20 18 14

But that looks like the other question?

bimawa avatar Dec 25 '21 15:12 bimawa

@bimawa: That last error is reported in #293. Seems like a bug in Python 3.10.

trygveaa avatar Dec 25 '21 17:12 trygveaa

Oh. ok thanks a lot!

bimawa avatar Dec 25 '21 18:12 bimawa

I also get this error. I installed the requirements.txt under a virtualenv within ~/.weechat/python/venv/ Python version within weechat: /python version gives python: 3.10.4 command line python version: $ python --version Python 3.10.4

I did an /upgrade within weechat incase something had to be loaded from a previous update and still get the same error: I link my main.py from my weechat-matrix git cloned dir to my ~/.weechat/python/matrix.py file.

here is the error within weechat:

python: stdout/stderr (?): Traceback (most recent call last):
python: stdout/stderr (?):   File "/mnt/wd1000/BTSync/RPi conf files/weechat/python/matrix.py", line 41, in <module>
python: stdout/stderr (?):     import logbook
python: stdout/stderr (?): ModuleNotFoundError: No module named 'logbook'
python: unable to parse file "/mnt/wd1000/BTSync/RPi conf files/weechat/python/matrix.py"```

thanks for any help to try and to get weechat-matrix loaded!

ikwyl6 avatar Apr 16 '22 23:04 ikwyl6

To add info from previous questions, see my pip list -v attached file.. weechat_matrix.pip.show.txt

Would love to get weechat-matrix working! Thanks for any help ahead of time...

ikwyl6 avatar Jun 19 '22 23:06 ikwyl6

To add info from previous questions, see my pip list -v attached file.. weechat_matrix.pip.show.txt

Would love to get weechat-matrix working! Thanks for any help ahead of time...

does your distro have a python logbook? on my system i solved with apt install -y python3-logbook distros manage to fix some of python's dumpster fire

clort81 avatar Mar 22 '23 11:03 clort81

It does now.. I haven't looked at this since submitting my comment back in June 2022.. But now it doesn't list Logbook under pip (maybe it was removed with some kind of update.. or I removed it not sure) but now the pkg is available under pacman and I installed the packages through it and any other requirements/dependencies and it now works! Thanks for the shove/bump as it made me re-look at it and now loads in weechat after these few steps..

ikwyl6 avatar Mar 23 '23 22:03 ikwyl6