OpenHarmony开发者论坛

标题: hb运行报`ModuleNotFoundError: No module named 'prompt_toolkit` [打印本页]

作者: paopaozhi    时间: 2023-12-1 09:01
标题: hb运行报`ModuleNotFoundError: No module named 'prompt_toolkit`
[md]错误:

`ModuleNotFoundError: No module named 'prompt_toolkit`

![image-20231130195236992.png](https://forums-obs.openharmony.c ... ttzl6a6sy6a4ba4.png "image-20231130195236992.png")

错误还原:

1. 通过hpm下载轻量代码
2. 运行 `hb set`发生错误

解决方案:

hb使用的是编译器及工具链子系统,所以直接下载 `prompt_toolkit`是没有用的,

```python
cd {工程目录}/prebuilts/python/linux-x86/3.9.2/bin
./python3.9 -m pip install prompt-toolkit==1.0.14 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
```

> ❗特别注意:-i 的镜像必须是http协议的,因为工具链子系统的python好像是不能认证ssl的!

下载后成功运行

![image-20231130200303537.png](https://forums-obs.openharmony.c ... xfll6x6bs2fijqx.png "image-20231130200303537.png")

![image-20231130200329521.png](https://forums-obs.openharmony.c ... a2omao04nqm4rkz.png "image-20231130200329521.png")
[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5