wideband 发表于 2023-3-25 14:32:42

No module named 'paddle'

使用pallhub自动加标点,运行提示:ModuleNotFoundError: No module named 'paddle'


# -*- coding: utf-8 -*-
# 使用讯飞语音转写API进行音频转文字#
import base64
import hashlib
import hmac
import json
import os
import re
import time
import urllib
import requests

import paddlehub as hub
mode = hub.Module(name='auto_punc', version='1.0.0')

sfqxx 发表于 2023-3-25 14:32:43

paddlepaddle-tiny仅支持到python 3.7
请看看版本

元豪 发表于 2023-3-25 14:38:43

没有名为paddle的模块 , 要用pip命令下载第三方库才行

在cmd窗口中输入 :
pip install paddlehub

isdkz 发表于 2023-3-25 14:40:14

你之前不是问过了吗?

wideband 发表于 2023-3-25 14:41:42

元豪 发表于 2023-3-25 14:38
没有名为paddle的模块 , 要用pip命令下载第三方库才行

在cmd窗口中输入 :

该命令无法完成安装,通过 pip install paddlehub -i https://mirrors.aliyun.com/pypi/simple --only-binary :all:完成了安装,查询:pip list ,显示 paddlehub版本:1.3.0.

其实,开始的时候,就是提示 No module named 'paddlehub' ,是安装 之后,此提示变成了 :No module named 'paddle'

wideband 发表于 2023-3-25 14:49:28

isdkz 发表于 2023-3-25 14:40
你之前不是问过了吗?

谢谢领导支持! 还没有彻底解决呢。
安装:
pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple

则提示:

ERROR: Could not find a version that satisfies the requirement paddlepaddle (from versions: none)
ERROR: No matching distribution found for paddlepaddle

isdkz 发表于 2023-3-25 15:20:43

你的 python 是32位的?

wideband 发表于 2023-3-25 15:22:36

isdkz 发表于 2023-3-25 15:20
你的 python 是32位的?

64bit

元豪 发表于 2023-3-25 15:30:01

wideband 发表于 2023-3-25 14:41
该命令无法完成安装,通过 pip install paddlehub -i https://mirrors.aliyun.com/pypi/simple --only-bi ...

啊这

isdkz 发表于 2023-3-25 15:35:13

wideband 发表于 2023-3-25 15:22
64bit

那你的版本也太低了吧,python3.6 都是可以安装的

wideband 发表于 2023-3-25 17:44:55

用 3.7版本ok:

pip install requests
pip install paddlehub==2.3.1
pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
pip install scipy

wideband 发表于 2023-3-25 20:25:41

punc_texts1 = mode.add_puncs(sencent)

punc_texts += mode.add_puncs(sencent)    #分成m个段子进行加标点,并返回每次加标点的第1个元素, 连接起来。

########################################################################################
punc_texts = ""
      m = (len(sencent)/10)
      for i in range(10):

            punc_texts += mode.add_puncs(sencent)
      with open("123.txt","w") as f:
            f.write(punc_texts)

wideband 发表于 2023-3-31 16:31:56

a = "abcdabcd"
b = len(a)/2
print("b = a/2 得到结果b:",b)

#b = a/2 得到结果b: 4.0

wideband 发表于 2023-3-31 16:46:10

fileName = fileName[:-4]

wideband 发表于 2023-3-31 16:47:20

c=a
print("a的第2段是:",c)

wideband 发表于 2023-4-1 08:05:19

返回对象的长度(项目数)。参数可以是序列(例如字符串、字节、元组、列表或范围)或集合(例如字典、集合或冻结集合)。

可以是:字符串(统计多少字符),可以是 列表 等。

list1 = ["test0","hi1","good2","morning3","forth5","five5"]
number1 = len(list1)
print(number1)

wideband 发表于 2023-4-1 08:26:28

turtle.forward(200) : 箭头正按照较快的速度往前挪200步( 默认:朝右的方向。)

turtle.left(90):方向改为 向左转90度

wideband 发表于 2023-4-1 08:48:27

num = 100.0
int(num)
print(type(num))

答案:float

wideband 发表于 2023-4-1 09:15:36

a = 10
if not 10>a:
    print(1)

# 等于 if not (10>a):, 因为:优先级   ()          >          not         and or

wideband 发表于 2023-4-2 09:11:27

:‘hello boy<’(这里得到的hello boy<是第一个[之前的内容)

解析:: 0为填入的数字,最大为 split(“o”) 里面分割符 O 的个数
str.split(“o”)得到的是第一个o之前的内容
str.split(“o”)得到的是第一个o和第二个o之间的内容
str.split(“o”)得到的是第三个o后和第四个o前之间的内容
str.split("[")得到的是第一个 [ 之前的内容
页: [1] 2
查看完整版本: No module named 'paddle'