windows不支持,现安装于linux

 pip install pyheif

用pip命令直接安装报错:

Collecting pyheifDownloading https://pypi.tuna.tsinghua.edu.cn/packages/a0/b5/74e08a65b3775153f72b2bf75adf9ca48f41db207e0d21dd7c8876e413cb/pyheif-0.5.1.tar.gz
Requirement already satisfied: cffi>=1.0.0 in /root/miniconda3/envs/pytorch_env/lib/python3.6/site-packages (from pyheif)
Requirement already satisfied: pycparser in /root/miniconda3/envs/pytorch_env/lib/python3.6/site-packages (from cffi>=1.0.0->pyheif)
Building wheels for collected packages: pyheifRunning setup.py bdist_wheel for pyheif ... errorComplete output from command /root/miniconda3/envs/pytorch_env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ydg5ncph/pyheif/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmppv0vja99pip-wheel- --python-tag cp36:running bdist_wheelrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.6creating build/lib.linux-x86_64-3.6/pyheifcopying pyheif/constants.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/error.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/reader.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/__init__.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/writer.py -> build/lib.linux-x86_64-3.6/pyheifcreating build/lib.linux-x86_64-3.6/pyheif/datacopying pyheif/data/version.txt -> build/lib.linux-x86_64-3.6/pyheif/datarunning build_extgenerating cffi module 'build/temp.linux-x86_64-3.6/_libheif_cffi.c'creating build/temp.linux-x86_64-3.6building '_libheif_cffi' extensioncreating build/temp.linux-x86_64-3.6/buildcreating build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6gcc -pthread -B /root/miniconda3/envs/pytorch_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -I/root/miniconda3/envs/pytorch_env/include/python3.6m -c build/temp.linux-x86_64-3.6/_libheif_cffi.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/_libheif_cffi.obuild/temp.linux-x86_64-3.6/_libheif_cffi.c:541:31: fatal error: libheif/heif.h: No such file or directorycompilation terminated.error: command 'gcc' failed with exit status 1----------------------------------------Failed building wheel for pyheifRunning setup.py clean for pyheif
Failed to build pyheif
Installing collected packages: pyheifRunning setup.py install for pyheif ... errorComplete output from command /root/miniconda3/envs/pytorch_env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ydg5ncph/pyheif/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-n6ojl3e5-record/install-record.txt --single-version-externally-managed --compile:running installrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.6creating build/lib.linux-x86_64-3.6/pyheifcopying pyheif/constants.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/error.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/reader.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/__init__.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/writer.py -> build/lib.linux-x86_64-3.6/pyheifcreating build/lib.linux-x86_64-3.6/pyheif/datacopying pyheif/data/version.txt -> build/lib.linux-x86_64-3.6/pyheif/datarunning build_extgenerating cffi module 'build/temp.linux-x86_64-3.6/_libheif_cffi.c'creating build/temp.linux-x86_64-3.6building '_libheif_cffi' extensioncreating build/temp.linux-x86_64-3.6/buildcreating build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6gcc -pthread -B /root/miniconda3/envs/pytorch_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -I/root/miniconda3/envs/pytorch_env/include/python3.6m -c build/temp.linux-x86_64-3.6/_libheif_cffi.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/_libheif_cffi.obuild/temp.linux-x86_64-3.6/_libheif_cffi.c:541:31: fatal error: libheif/heif.h: No such file or directorycompilation terminated.error: command 'gcc' failed with exit status 1----------------------------------------
Command "/root/miniconda3/envs/pytorch_env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ydg5ncph/pyheif/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-n6ojl3e5-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ydg5ncph/pyheif/

显示缺少依赖包,查阅了很多资料说是缺少devel。

去pip官网查看

需要先安装libffi libheif-dev libde65-dev

将第一条命令拷贝到linux报错:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libffi
E: Unable to locate package libheif-dev

显示无法定位软件包,于是找能找到的软件包,输入如下命令

sudo apt search libffi

得到结果

正在排序... 完成
全文搜索... 完成
libffi-dev/xenial,now 3.2.1-4 amd64 [已安装]Foreign Function Interface library (development files)libffi6/xenial,now 3.2.1-4 amd64 [已安装,自动]Foreign Function Interface library runtimelibffi6-dbg/xenial 3.2.1-4 amd64Foreign Function Interface library runtime (debug symbols)libffindex0/xenial 0.9.9.6-2 amd64library for simple index/database for huge amounts of small fileslibffindex0-dev/xenial 0.9.9.6-2 amd64library for simple index/database for huge amounts of small files (development)

搜索后可以看到结果中,显示已安装了libffi-dev和libffi6 (最相关的libffi6)如果没有显示已安装的小伙伴直接输入如下命令:

sudo apt-get install libffi-devsudo apt-get install libffi6

再安装libde265-dev

sudo apt-get install libde265-dev

显示如下就安装成功

正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会同时安装下列软件:libde265-0
下列【新】软件包将被安装:libde265-0 libde265-dev
升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 70 个软件包未被升级。
需要下载 245 kB 的归档。
解压缩后会消耗 709 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://archive.ubuntu.com/ubuntu xenial/universe amd64 libde265-0 amd64 1.0.2-2 [234 kB]
获取:2 http://archive.ubuntu.com/ubuntu xenial/universe amd64 libde265-dev amd64 1.0.2-2 [11.6 kB]
已下载 245 kB,耗时 2秒 (100 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
正在选中未选择的软件包 libde265-0:amd64。
(正在读取数据库 ... 系统当前共安装有 44486 个文件和目录。)
正准备解包 .../libde265-0_1.0.2-2_amd64.deb  ...
正在解包 libde265-0:amd64 (1.0.2-2) ...
正在选中未选择的软件包 libde265-dev:amd64。
正准备解包 .../libde265-dev_1.0.2-2_amd64.deb  ...
正在解包 libde265-dev:amd64 (1.0.2-2) ...
正在处理用于 libc-bin (2.23-0ubuntu11) 的触发器 ...
/sbin/ldconfig.real: file /usr/local/cuda-10.0/targets/x86_64-linux/lib/libcudnn.so.7 is truncated/sbin/ldconfig.real: file /usr/local/cuda-10.0/targets/x86_64-linux/lib/libcudnn.so is truncated/sbin/ldconfig.real: file /usr/local/cuda-10.0/targets/x86_64-linux/lib/libcudnn.so.7.6.4 is truncated

再继续安装pyheif

pip install git+https://github.com/david-poirier-csn/pyheif.git

还是报错

Collecting git+https://github.com/david-poirier-csn/pyheif.gitCloning https://github.com/david-poirier-csn/pyheif.git to /tmp/pip-9gala2t_-build
Requirement already satisfied: cffi>=1.0.0 in /root/miniconda3/envs/pytorch_env/lib/python3.6/site-packages (from pyheif==0.5.1)
Requirement already satisfied: pycparser in /root/miniconda3/envs/pytorch_env/lib/python3.6/site-packages (from cffi>=1.0.0->pyheif==0.5.1)
Installing collected packages: pyheifRunning setup.py install for pyheif ... errorComplete output from command /root/miniconda3/envs/pytorch_env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-9gala2t_-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-5m593lml-record/install-record.txt --single-version-externally-managed --compile:running installrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.6creating build/lib.linux-x86_64-3.6/pyheifcopying pyheif/constants.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/error.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/reader.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/__init__.py -> build/lib.linux-x86_64-3.6/pyheifcopying pyheif/writer.py -> build/lib.linux-x86_64-3.6/pyheifcreating build/lib.linux-x86_64-3.6/pyheif/datacopying pyheif/data/version.txt -> build/lib.linux-x86_64-3.6/pyheif/datarunning build_extgenerating cffi module 'build/temp.linux-x86_64-3.6/_libheif_cffi.c'creating build/temp.linux-x86_64-3.6building '_libheif_cffi' extensioncreating build/temp.linux-x86_64-3.6/buildcreating build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6gcc -pthread -B /root/miniconda3/envs/pytorch_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include -I/opt/local/include -I/root/miniconda3/envs/pytorch_env/include/python3.6m -c build/temp.linux-x86_64-3.6/_libheif_cffi.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/_libheif_cffi.obuild/temp.linux-x86_64-3.6/_libheif_cffi.c:541:31: fatal error: libheif/heif.h: No such file or directorycompilation terminated.error: command 'gcc' failed with exit status 1

还是显示没有libheif/heif.h,下载libheif-dev

apt-get install libheif-dev

报错

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libheif-dev

卧槽,无情!

更新apt

sudo apt-get update
命中:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
命中:2 http://archive.ubuntu.com/ubuntu xenial InRelease
忽略:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  InRelease
命中:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
命中:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
忽略:6 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64  InRelease
命中:7 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Release
命中:8 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64  Release
正在读取软件包列表... 完成

继续,还是报错

ubuntu是16的版本,比较老,没有源,去找相应的源,安装就行(大佬帮我搞的)。

heic格式图片转为jpg格式 安装pyheif相关推荐

  1. Python实现小工具:批量将任意格式图片转为 JPG 格式

    1.需求分析 写博客的时候发现这样一个问题:自己在 Mac 上截的图都是高清的 PNG 格式图片,最小的也超过 1MB.直接放在博客里,既占用服务器存储空间,又导致博客加载出来很慢,体验不好.而且写博 ...

  2. Latex写文章~如何将pdf格式图片转为eps格式

    最近写论文R1回复时说文件缺失,并且图片要求tif或者eps格式. The text file of your manuscript is missing. An editable text file ...

  3. Matlab img格式图片转为dicom格式

    转自 http://blog.chinaunix.net/uid-423637-id-357859.html matlab代码: %img是三维图像,将其转换为一个序列的二维dcm格式的图像 %读取a ...

  4. java png转svg_png格式图片转为svg格式图片

    UML类图关系--继承(泛化).实现.关联.聚合.组合.依赖 在UML类图中,常见的有以下几种关系:  泛化(Generalization),  实现(Realization),关联(Associat ...

  5. python图片保存jpg、show变成bmp_利用python实现.dcm格式图像转为.jpg格式

    如下所示: import pydicom import matplotlib.pyplot as plt import scipy.misc import pandas as pd import nu ...

  6. 为什么要将图片转为base64格式

    图片的 base64 编码就是可以将一副图片数据编码成一串字符串,使用该字符串代替图像地址; 1. 提升性能: 网页上的每一个图片,都是需要消耗一个 http 请求下载而来的, 图片的下载始终都要向服 ...

  7. OpenCV应用:将jpg格式的图片转为bmp格式的图片

    将jpg格式的图片转为bmp格式的图片 之前看到一篇博文,说用cvLoadImage函数读出来的是IplImage类的值,同时cvSaveImage的输入也是IplImage类的值,这就可以通过这两个 ...

  8. 怎么将图片转为png格式?格式转换器的使用方法

    图片转换格式是我们日常图片处理时,经常会用到的一项功能,它可以将图片格式转换(https://www.yasuotu.com/geshi)成我们需要的格式类型,比如jpg转png.png转ico.jp ...

  9. 使用canvas.toDataURL把图片转为base64格式

    使用canvas.toDataURL把图片转为base64格式 function getBase64(url) {//通过构造函数来创建的 img 实例,在赋予 src 值后就会立刻下载图片,相比 c ...

最新文章

  1. 用好ASP.NET 2.0的URL映射
  2. Git Manual / Git使用手册 / Git, GitLab, Git Bash, TortoiseGit (建议全文复制到Word文档中通过导航窗格查看)...
  3. android 中 webview 怎么用 localStorage?
  4. 【负载均衡】揭开F5 BIG-IP的神秘面纱(一)
  5. android 处理双击事件
  6. python如何读取配置文件获取url以及hhead_python爬虫小工具:(模块:copyhreaders,直接复制头文件,无须挨个添加双引号)...
  7. MS SQL SERVER中备份所有数据库
  8. 二、Android应用的界面编程(六)ProgressBar及其子类[SeekBar、RatingBar]er
  9. navicat 连接mysql is not allowed to connect to this mysql server
  10. [知识竞赛策划方案][图]何用PPT制作知识竞赛所需要的题库?作为一个普通的单位,由于不具备电视台专用的比赛平台,如果要搞一场极致专业的知识竞赛?同时花钱最少?
  11. 201671010119 2016-2017-2《Java程序设计》第十六周学习心得
  12. linux查看lammps版本,lammps linux
  13. 电力系统谐波分析代码
  14. 【单片机】2.1 AT89S52单片机的硬件组成
  15. 2019-1-3 每日一记
  16. 神经网络权重是什么意思,神经网络权值和阈值
  17. OutOfMemoryError(OOM)和StackOverflowError(SOF)异常总结
  18. ios html转换成网页,ios App加载本地HTML网页,点击网页链接跳转到app页面的方法
  19. 权威发布丨2022 中国开源先锋 33 人之心尖上的开源人物
  20. 安卓分屏神器_手机端必备神器,一经推出轻松拥有过千万用户下载量!

热门文章

  1. UTF-8的繁体与简体转换
  2. 学习stm32中断、DMA通信原理和编程方法
  3. 电商系统购物车设计思路
  4. 使用Python按时间顺序批量重命名文件
  5. ios visio流程图_IOS APP设计流程
  6. 教师python培训心得体会
  7. I2C协议研读(六):快速模式、高速模式以及10位寻址
  8. 【中级计量经济学】Lecture 2 多重共线性
  9. go mysql 异步_GO操作MYSQL
  10. NX二次开发-UFUN获取part的单位(公制/英制)UF_PART_ask_units