django - ImportError: 找不到 zbar 共享库
问题描述
我正在尝试使用 Django 框架制作在线条形码阅读器并将其部署在 Heroku 上。但是当我加载页面时,它显示了这个错误:
ImportError at /
Unable to find zbar shared library
Request Method: GET
Request URL: https://libportal.herokuapp.com/
Django Version: 2.0.3
Exception Type: ImportError
Exception Value:
Unable to find zbar shared library
Exception Location: /app/.heroku/python/lib/python3.6/site-packages
/pyzbar/zbar_library.py in load, line 65
Python Executable: /app/.heroku/python/bin/python
Python Version: 3.6.4
Python Path:
['/app',
'/app/.heroku/python/bin',
'/app',
'/app/.heroku/python/lib/python36.zip',
'/app/.heroku/python/lib/python3.6',
'/app/.heroku/python/lib/python3.6/lib-dynload',
'/app/.heroku/python/lib/python3.6/site-packages']
Server time: Thu, 31 May 2018 11:02:16 +0000
我对其进行了搜索,并在此处找到了一种合适的解决方案。
但在我的情况下pyzbar
,使用 pip 成功安装,然后在看到上述解决方案后libzbar-dev
通过将其添加到文件中进行安装。Aptfile
有人可以帮我吗?
解决方案
推荐阅读
- javascript - 请求有数据但 axios 没有读取
- java - 如何在使用比较器接口时获取 Rectangle 对象的数组列表以显示每个 Rectangle 的区域
- visual-studio - 使用 Visual Studio 调试 Unity 时出现“没有运行兼容的代码”
- postgresql - 检查两个值是否存在并返回命名布尔值
- java - 通过在 Java 项目中导入库
- api - Consul - 具有超过 1 个服务的外部服务注册
- php - 在 Woocommerce 中更改删除购物车项目 url
- javascript - 对象数组,按父对象分组
- python - 什么决定了python的help()列出的方法?
- python - 带有 Pandas Dataframe 的文档语料库的字数矩阵