使用ReactPy报错:RuntimeError: No built-in server implementation installed.解决



一、问题呈现

在初次运行ReactPy报错raise RuntimeError("No built-in server implementation installed.") RuntimeError: No built-in server implementation installed.具体报错信息如下:

D:\install\develop\Anaconda3\envs\py37\Scripts\python.exe D:\Datas\CodeDate\PythonCode\ReactPy-Web-test\src\common\test-web.py 
2023-06-14T09:53:18+0800 | WARNING | The `run()` function is only intended for testing during development! To run in production, consider selecting a supported backend and importing its associated `configure()` function from `reactpy.backend.<package>` where `<package>` is one of ['starlette', 'fastapi', 'sanic', 'tornado', 'flask']. For details refer to the docs on how to run each package.
Traceback (most recent call last):
  File "D:\install\develop\Anaconda3\envs\py37\lib\site-packages\reactpy\backend\default.py", line 59, in _default_implementation
    implementation = next(all_implementations())
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Datas\CodeDate\PythonCode\ReactPy-Web-test\src\common\test-web.py", line 7, in <module>
    run(hello_world)
  File "D:\install\develop\Anaconda3\envs\py37\lib\site-packages\reactpy\backend\utils.py", line 37, in run
    app = implementation.create_development_app()
  File "D:\install\develop\Anaconda3\envs\py37\lib\site-packages\reactpy\backend\default.py", line 28, in create_development_app
    return _default_implementation().create_development_app()
  File "D:\install\develop\Anaconda3\envs\py37\lib\site-packages\reactpy\backend\default.py", line 62, in _default_implementation
    raise RuntimeError("No built-in server implementation installed.")
RuntimeError: No built-in server implementation installed.

截图如下
在这里插入图片描述

二、问题原因及解决办法

去百度并没有找到相关解释,所这里我就记录一下,供后来人参考
针对这个问题,我排查了一点点时间,最后在ReactPy开发官网找到了问题的原因。
先上ReactPy开发官网地址:https://reactpy.dev/docs/guides/getting-started/index.html
在页面中有这样一句话:
在这里插入图片描述
大概意思是说,安装ReactPy的同时还需要安装一个支持ReactPy的服务器–这里推荐starlette,安装命令如下:

pip install "reactpy[starlette]"

ps:
报错的原因就是我直接只安装了ReactPy,而没有安装服务器,为此出现了问题,所以大家这里记得一定要用这个命令进行安装:pip install "reactpy[starlette]"

三、处理结果

然后在运行就可以成功啦,成功相关截图如下:
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小雏菊的成长

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值