我正在尝试运行作曲家更新,出现以下错误
Problem 1
- The requested PHP extension ext-zip * is missing from your system. Install or enable PHP's zip extension.
Problem 2
- maatwebsite/excel 3.1.10 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
- maatwebsite/excel 3.1.11 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
- maatwebsite/excel 3.1.12 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].
- maatwebsite/excel 3.1.13 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.6.0, 1.7.0, 1.8.0, …Run Code Online (Sandbox Code Playgroud) 我从API获取以下数据.我试图使用Python脚本访问餐厅名称并让脚本显示它.这是我的文件:
test.py
with open('data.json') as data_file:
data = json.load(data_file)
for restaurant in data:
print data ['restaurants'][0]['restaurant']['name']
Run Code Online (Sandbox Code Playgroud)
我的JSON文件如下:(简化)
{
"results_found": 3296,
"results_start": 0,
"results_shown": 20,
"restaurants": [
{
"restaurant": {
"R": {
"res_id": 9101083
},
"id": "9101083",
"name": "My Meat Wagon",
"address": "Market Square, Smithfield, Dublin Dublin 7",
"locality": "Smithfield",
"city": "Dublin",
"city_id": 91,
"latitude": "53.3489980000",
"longitude": "-6.2788120000",
"zipcode": "Dublin 7",
"events_url": "https://www.zomato.com/dublin/my-meat-wagon-smithfield/events#tabtop?utm_source=api_basic_user&utm_medium=api&utm_campaign=v2.1",
"establishment_types": []
}
},
{
"restaurant": {
"R": {
"res_id": 9101628
},
"id": "9101628",
"name": "Wowburger",
"url": "https://www.zomato.com/dublin/wowburger-temple-bar?utm_source=api_basic_user&utm_medium=api&utm_campaign=v2.1", …Run Code Online (Sandbox Code Playgroud) 我只想通过 id 获取用户,如果他们没有deleted=0. 我试过
user = User.query.filter_by(deleted=0).get(id)
Run Code Online (Sandbox Code Playgroud)
但出现错误。如何过滤查询并通过 id 获取?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/david/.virtualenvs/flask-sqlalchemy/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 831, in get
return self._get_impl(ident, loading.load_on_ident)
File "/home/david/.virtualenvs/flask-sqlalchemy/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 864, in _get_impl
return fallback_fn(self, key)
File "/home/david/.virtualenvs/flask-sqlalchemy/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 177, in load_on_ident
q._get_condition()
File "/home/david/.virtualenvs/flask-sqlalchemy/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 350, in _get_condition
"get", order_by=False, distinct=False)
File "/home/david/.virtualenvs/flask-sqlalchemy/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 368, in _no_criterion_condition
self._no_criterion_assertion(meth, order_by, distinct)
File "/home/david/.virtualenvs/flask-sqlalchemy/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 365, in _no_criterion_assertion
"Query with existing criterion. " % meth)
sqlalchemy.exc.InvalidRequestError: …Run Code Online (Sandbox Code Playgroud)