首页 > 解决方案 > 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


有人可以帮我吗?

标签: djangopython-3.xherokuapt-getzbar

解决方案


推荐阅读