[Problem]
mmlab failed to load using custom_imports, and an error occurred when debugging and discovering the import:
ModuleNotFoundError: No module named '_bz2'
[Solution]
Refer to the answer at the end of https://stackoverflow.com/questions/50335503/no-module-named-bz2-in-python3 .
- Download file:
https://github.com/nuaalyh/Note/blob/master/python/_bz2.cpython-38-x86_64-linux-gnu.so - Place the file in the relevant path
cp _bz2.cpython-38-x86_64-linux-gnu.so /usr/local/python3/lib/python3.9/lib-dynload/
- Modify file permissions
chmod +x _bz2.cpython-38-x86_64-linux-gnu.so
[Appendix]
If you encounter the problem ModuleNotFoundError: No module named '_lzma' later, you can check:
https://blog.csdn.net/qq_39735236/article/details/130954074?spm=1001.2014.3001.5502