FS#67270 - [calibre-python3] calibre execution fails because it thinks msgpack is missing

Attached to Project: Community Packages
Opened by Alvaro García (rainbyte) - Monday, 13 July 2020, 23:42 GMT
Last edited by Eli Schwartz (eschwartz) - Tuesday, 14 July 2020, 02:49 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Calibre fails to execute because it thinks msgpack is missing, but python-msgpack is installed on my system.

Additional info:

This is the console output:

```
➤ calibre
Traceback (most recent call last):
File "/usr/bin/calibre", line 19, in <module>
from calibre.gui_launch import calibre
File "/usr/lib/calibre/calibre/__init__.py", line 23, in <module>
from calibre.startup import winutil, winutilerror
File "/usr/lib/calibre/calibre/startup.py", line 143, in <module>
set_translators()
File "/usr/lib/calibre/calibre/utils/localization.py", line 260, in set_translators
q = translator_for_lang(lang)
File "/usr/lib/calibre/calibre/utils/localization.py", line 217, in translator_for_lang
mpath = get_lc_messages_path(lang)
File "/usr/lib/calibre/calibre/utils/localization.py", line 110, in get_lc_messages_path
if lang in available_translations():
File "/usr/lib/calibre/calibre/utils/localization.py", line 24, in available_translations
stats = msgpack_loads(f.read())
File "/usr/lib/calibre/calibre/utils/serialize.py", line 112, in msgpack_loads
import msgpack
ModuleNotFoundError: No module named 'msgpack'
```

Steps to reproduce:

1. Install calibre-python3.
2. Check if msgpack is installed, it should be
3. Try to open calibre, it fails.
4. See console output, it says msgpack is missing.
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Tuesday, 14 July 2020, 02:49 GMT
Reason for closing:  Not a bug
Additional comments about closing:  User error
Comment by Eli Schwartz (eschwartz) - Tuesday, 14 July 2020, 01:39 GMT
You claim python-msgpack is installed, but the python interpreter claims it isn't.

What's the output of

type -a python
type -a python3
python3 -c 'import msgpack; print(msgpack)'
python3 -c 'import sys; print(sys.path)'
pacman -Qkk python-msgpack
pacman -Ql python-msgpack
Comment by Doug Newgard (Scimmia) - Tuesday, 14 July 2020, 02:05 GMT
are you using anaconda, venvs, or anything of that sort?
Comment by Alvaro García (rainbyte) - Tuesday, 14 July 2020, 02:33 GMT
I'm using Python from system repo, here the output

➤ which python
/usr/bin/python

➤ python3 -c 'import msgpack; print(msgpack)'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'msgpack'

➤ pacman -Qkk python-msgpack
python-msgpack: 27 archivos totales, 0 archivos alterados

➤ pacman -Ql python-msgpack
python-msgpack /usr/
python-msgpack /usr/lib/
python-msgpack /usr/lib/python3.8/
python-msgpack /usr/lib/python3.8/site-packages/
python-msgpack /usr/lib/python3.8/site-packages/msgpack-1.0.0-py3.8.egg-info/
python-msgpack /usr/lib/python3.8/site-packages/msgpack-1.0.0-py3.8.egg-info/PKG-INFO
python-msgpack /usr/lib/python3.8/site-packages/msgpack-1.0.0-py3.8.egg-info/SOURCES.txt
python-msgpack /usr/lib/python3.8/site-packages/msgpack-1.0.0-py3.8.egg-info/dependency_links.txt
python-msgpack /usr/lib/python3.8/site-packages/msgpack-1.0.0-py3.8.egg-info/top_level.txt
python-msgpack /usr/lib/python3.8/site-packages/msgpack/
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__init__.py
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__pycache__/
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__pycache__/__init__.cpython-38.opt-1.pyc
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__pycache__/__init__.cpython-38.pyc
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__pycache__/_version.cpython-38.opt-1.pyc
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__pycache__/_version.cpython-38.pyc
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__pycache__/exceptions.cpython-38.opt-1.pyc
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__pycache__/exceptions.cpython-38.pyc
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__pycache__/ext.cpython-38.opt-1.pyc
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__pycache__/ext.cpython-38.pyc
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__pycache__/fallback.cpython-38.opt-1.pyc
python-msgpack /usr/lib/python3.8/site-packages/msgpack/__pycache__/fallback.cpython-38.pyc
python-msgpack /usr/lib/python3.8/site-packages/msgpack/_cmsgpack.cpython-38-x86_64-linux-gnu.so
python-msgpack /usr/lib/python3.8/site-packages/msgpack/_version.py
python-msgpack /usr/lib/python3.8/site-packages/msgpack/exceptions.py
python-msgpack /usr/lib/python3.8/site-packages/msgpack/ext.py
python-msgpack /usr/lib/python3.8/site-packages/msgpack/fallback.py
Comment by Alvaro García (rainbyte) - Tuesday, 14 July 2020, 02:37 GMT
This one seems strange:

➤ type -a python3
python3 is /home/rainbyte/Toolchains/armv7-eabihf--glibc--bleeding-edge-2020.02-2/bin/python3
python3 is /usr/bin/python3

I was using the toolchain to compile Rust program for arm, maybe it added itself to $PATH?

edit: also here:

➤ python3 -c 'import sys; print(sys.path)'
['', '/home/rainbyte/Toolchains/armv7-eabihf--glibc--bleeding-edge-2020.02-2/lib/python38.zip', '/home/rainbyte/Toolchains/armv7-eabihf--glibc--bleeding-edge-2020.02-2/lib/python3.8', '/home/rainbyte/Toolchains/armv7-eabihf--glibc--bleeding-edge-2020.02-2/lib/python3.8/lib-dynload', '/home/rainbyte/Toolchains/armv7-eabihf--glibc--bleeding-edge-2020.02-2/lib/python3.8/site-packages']
Comment by Eli Schwartz (eschwartz) - Tuesday, 14 July 2020, 02:48 GMT
Yeah, you're using a totally invalid python that is screwing up every single python program you try to use. Calibre merely happens to be one of them. Don't add these alternative python copies to your default $PATH.

Loading...