我正在尝试运行 cv2,当我尝试导入它时,我得到了
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
在线建议的解决方案是安装
apt install libgl1-mesa-glx
但这已经安装并且是最新版本。任何帮助都会非常有帮助。提前致谢。
我在 StackOverflow 上进行了搜索,寻找可以帮助我使 Web API 正常工作的答案,但不知何故,我仍然没有我需要的答案。我已经遵循了所有必要的步骤,直到我可以将项目部署到 heroku(通过 Github),并且它没有显示构建错误。Procfile 已经包含在内,我的 requirements.txt 也是如此。请参阅以下内容:
项目目录:
app-directory/
|-main-api.py
|-Procfile
|-requirements.txt
|-..other files..
Run Code Online (Sandbox Code Playgroud)
Procfile(更新):
web: gunicorn --bind 127.0.0.1:5000 main-api:app
Run Code Online (Sandbox Code Playgroud)
要求.txt:
在主 api.py...
@app.route('/', methods=['GET'])
def get_index():
customers = mongo.db.customers
output = []
for c in customers.find():
output.append({'_id': c['_id'], 'first_name': c['first_name'],
'last_name': c['last_name'],
'date_of_birth': c['date_of_birth'],
'is_online': c['is_online']})
return jsonify({'results': output})
Run Code Online (Sandbox Code Playgroud)
最后……在 Heroku 中运行 web 项目:
Heroku Web - Python-Flask-错误
任何有类似经验或对这个问题有正确解决方案的人,如果你能分享它,不胜感激。感谢百万人!
PS 抱歉,我忘了从 Heroku 添加日志:
2017-04-24T18:22:17.118866+00:00 heroku[web.1]: Starting process with command `gunicorn --bind 127.0.0.1:5000 …
Run Code Online (Sandbox Code Playgroud)