converter icon indicating copy to clipboard operation
converter copied to clipboard

calibre安装完了之后运行,提示如下,请问遇到过吗

Open devilmengcry opened this issue 8 years ago • 15 comments

 File "site.py", line 77, in main
  File "site-packages/calibre/gui_launch.py", line 73, in calibre
  File "site-packages/calibre/gui2/__init__.py", line 7, in <module>
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

devilmengcry avatar Jan 27 '18 15:01 devilmengcry

你的是什么操作系统?安装的calibre是什么版本?你是按照官网的教程安装的吗? 执行以下:

ebook-convert --version

能看到版本号码

TruthHun avatar Jan 27 '18 16:01 TruthHun

我用的是centos7 官网就只有一条安装命令 sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()" 安装的时候最后报出

____________________ WARNING ____________________
Setting up completion failed with error:
__________________________________________________


	Traceback (most recent call last):
	  File "site-packages/calibre/linux.py", line 753, in setup_completion
	  File "site-packages/calibre/linux.py", line 508, in write_completion
	  File "site-packages/calibre/gui2/__init__.py", line 7, in <module>
	ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Setting up desktop integration...
Run "calibre" to start calibre

运行calibre提示

Traceback (most recent call last):
  File "site.py", line 77, in main
  File "site-packages/calibre/gui_launch.py", line 73, in calibre
  File "site-packages/calibre/gui2/__init__.py", line 7, in <module>
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

ebook-convert --version

ebook-convert (calibre 3.16.0)
Created by: Kovid Goyal <[email protected]>

devilmengcry avatar Jan 28 '18 00:01 devilmengcry

执行

ebook-convert --version

能看到版本号,说明已安装成功了。你那个错误只是WARNING级别。你试着创建个text文本,比如example.txt,里面随便写些内容,然后执行

ebook-convert example.txt example.pdf

把文本内容转成PDF,如果转成功,那基本没问题。

TruthHun avatar Jan 28 '18 00:01 TruthHun

网上帮查了下,缺少libgl.so库,你看下centos怎么安装这个库。

TruthHun avatar Jan 28 '18 00:01 TruthHun

安装了 yum -y install qt5-qtbase-gui qt5-qtdeclarative之后 ebook-convert /tmp/sessionId/content.epub /tmp/sessionId/output/book.mobi成功 ebook-convert /tmp/sessionId/content.epub /tmp/sessionId/output/book.docx成功 ebook-convert /tmp/sessionId/content.epub /tmp/sessionId/output/book.epub成功 ebook-convert /tmp/sessionId/content.epub /tmp/sessionId/output/book.pdf失败

错误如下:

Creating PDF Output...
67% Running PDF Output plugin
Splitting markup on page breaks and flow limits, if any...
Traceback (most recent call last):
  File "site.py", line 77, in main
  File "site-packages/calibre/ebooks/conversion/cli.py", line 391, in main
  File "site-packages/calibre/ebooks/conversion/plumber.py", line 1252, in run
  File "site-packages/calibre/ebooks/conversion/plugins/pdf_output.py", line 177, in convert
  File "site-packages/calibre/ebooks/conversion/plugins/pdf_output.py", line 240, in convert_text
  File "site-packages/calibre/ebooks/pdf/render/from_html.py", line 17, in <module>
ImportError: libXcomposite.so.1: cannot open shared object file: No such file or directory

devilmengcry avatar Jan 28 '18 00:01 devilmengcry

先试着转化下文档,刚刚说的创建个example.txt文档进行转化测试。看下转化效果,转化成功了那基本没问题了。

ebook-convert example.txt example.pdf

TruthHun avatar Jan 28 '18 00:01 TruthHun

缺什么库就安装什么库吧,我的calibre的环境是Ubuntu,就一行命令全搞定了。centos我没试过,我这边使用的是Ubuntu系统。

TruthHun avatar Jan 28 '18 00:01 TruthHun

请问问题解决了吗?我centos7也遇到这个问题了。

yemengge avatar Mar 06 '18 08:03 yemengge

@yemengge 没有找到原因,我这有很多centos7,几台成功几台失败。

devilmengcry avatar Mar 06 '18 08:03 devilmengcry

好吧,谢啦

yemengge avatar Mar 06 '18 08:03 yemengge

请问还需要安装Qt吗?

报错信息换了。

[root@MiWiFi-R3-srv tmp]# ebook-convert 111.txt qqq.pdf 1% Converting input to HTML... InputFormatPlugin: TXT Input running on /tmp/111.txt Language not specified Creator not specified Building file list... Normalizing filename cases Rewriting HTML links flow is too short, not running heuristics Forcing index.html into XHTML namespace 34% Running transforms on e-book... Merging user specified metadata... Detecting structure... Auto generated TOC with 0 entries. Flattening CSS and remapping font sizes... Source base font size is 12.00000pt Removing fake margins... Cleaning up manifest... Trimming unused files from manifest... Creating PDF Output... 67% Running PDF Output plugin Splitting markup on page breaks and flow limits, if any... This application failed to start because it could not find or load the Qt platform plugin "headless" in "/opt/calibre/lib/python2.7/site-packages/calibre/plugins".

Available platform plugins are: headless (from /opt/calibre/lib/python2.7/site-packages/calibre/plugins), linuxfb, minimal, offscreen, xcb.

Reinstalling the application may fix this problem. Aborted

yemengge avatar Mar 06 '18 09:03 yemengge

1、在阿里云CentOS7.4安装calibre碰到了之前在其它版本未遇到的很多问题,安装了如下依赖包,使得ebook-convert可以生成各种文件: yum -y install mesa-libGL.x86_64 yum -y install ImageMagick yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc gcc-c++ openssl-devel yum install Xcb yum -y install qt5*

2、虽然生成文件了,但中文都没了,是因为Linux系统少了中文字体 将Windows系统的C:\Windows\Fonts目录中的中文字体(比如输入微软雅黑)上传到Linux,可在 /usr/share/fonts/下创建一个目录(比如chinese)保存各种中文字体

bitprince avatar Nov 10 '18 16:11 bitprince

3QU

51stack avatar Jan 16 '19 09:01 51stack

Trimming unused files from manifest... Creating PDF Output... 67% Running PDF Output plugin 68% Parsed all content for markup transformation 70% Completed markup transformation [18491:18491:1127/195515.139701:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

PWA2000 avatar Nov 27 '19 11:11 PWA2000

Trimming unused files from manifest... Creating PDF Output... 67% Running PDF Output plugin 68% Parsed all content for markup transformation 70% Completed markup transformation [18491:18491:1127/195515.139701:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

I got the same error...have you solved this problem?

JoanJiao avatar Apr 01 '20 09:04 JoanJiao