Comments (15)
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)保存各种中文字体
from converter.
你的是什么操作系统?安装的calibre是什么版本?你是按照官网的教程安装的吗?
执行以下:
ebook-convert --version
能看到版本号码
from converter.
我用的是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]>
from converter.
执行
ebook-convert --version
能看到版本号,说明已安装成功了。你那个错误只是WARNING级别。你试着创建个text文本,比如example.txt,里面随便写些内容,然后执行
ebook-convert example.txt example.pdf
把文本内容转成PDF,如果转成功,那基本没问题。
from converter.
网上帮查了下,缺少libgl.so
库,你看下centos怎么安装这个库。
from converter.
安装了
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
from converter.
先试着转化下文档,刚刚说的创建个example.txt文档进行转化测试。看下转化效果,转化成功了那基本没问题了。
ebook-convert example.txt example.pdf
from converter.
缺什么库就安装什么库吧,我的calibre的环境是Ubuntu,就一行命令全搞定了。centos我没试过,我这边使用的是Ubuntu系统。
from converter.
请问问题解决了吗?我centos7也遇到这个问题了。
from converter.
@yemengge 没有找到原因,我这有很多centos7,几台成功几台失败。
from converter.
好吧,谢啦
from converter.
请问还需要安装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
from converter.
3QU
from converter.
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.
from converter.
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?
from converter.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from converter.