最近看到FastApi这个东西很好用,拿来试试,先用uvicorn作为服务容器
把官网的例程套上去看看
async def app(scope, receive, send):
assert scope['type'] == 'http'
await send({
'type': 'http.response.start',
'status': 200,
'headers': [
[b'content-type', b'text/plain'],
]
})
await send({
'type': 'http.response.body',
'body': b'Hello, world!',
})
整了好久一直出现问题:
![](https://img.haomeiwen.com/i21470277/686160d9e28d5b5a.png)
最后发现是这个服务把我的8000端口占用了
![](https://img.haomeiwen.com/i21470277/f5979c83c86a6159.png)
果断关掉,结果就出现了
![](https://img.haomeiwen.com/i21470277/685ae3bbafe111a8.png)
关于安装sqlalchemy一直安装不成功,即使安装了pimysql也不行
![](https://img.haomeiwen.com/i21470277/d4e425242c7773da.png)
看到问题里有这个,查了一下发现因为Python3.4有一个标准库枚举模块,所以应该卸载Enum34,因为在Python3.6中添加了Enum.Intflag,所以它不再与标准库中的枚举兼容。
pip uninstall enum34
![](https://img.haomeiwen.com/i21470277/afe22e470634a33e.png)
终于搞定了
网友评论