简体   繁体   English

sh:1:start:not found 是什么意思?

[英]What does sh:1:start:not found mean?

I am making a raspberry pi chatbot using google text to speech.我正在使用谷歌文本到语音制作一个树莓派聊天机器人。 Here is my code:这是我的代码:

import os
from gtts import gTTS
import time

text_to_read = "Hello my name is Alex. What's your name? "


language = 'en'
slow_audio_speed = False
filename = '1.mp3'
filename2 = '2.mp3'
filename3 = '3.mp3'
filename4 = '4.mp3'
filename5 = '5.mp3'
filename6 = '6.mp3'
filename7 = '7.mp3'
filename8 = '8.mp3'
filename9 = '9.mp3'
filename10 = '10.mp3'
filename11 = '11.mp3'
filename12 = '12.mp3'


def reading_from_string():
    audio_created = gTTS(text=text_to_read, lang=language,
                         slow=slow_audio_speed)
    audio_created.save(filename)


    os.system(f'start {filename}')
def reading_from_string2():
    audio_created2 = gTTS(text=text_to_read2, lang=language,
                         slow=slow_audio_speed)
    audio_created2.save(filename2)

    os.system(f'start {filename2}')
def reading_from_string3():
    audio_created3 = gTTS(text=text_to_read3, lang=language,
                         slow=slow_audio_speed)
    audio_created3.save(filename3)

    os.system(f'start {filename3}')

def reading_from_string4():
    audio_created4 = gTTS(text=text_to_read4, lang=language,
                         slow=slow_audio_speed)
    audio_created4.save(filename4)

    os.system(f'start {filename4}')

def reading_from_string5():
    audio_created5 = gTTS(text=text_to_read5, lang=language,
                         slow=slow_audio_speed)
    audio_created5.save(filename5)

    os.system(f'start {filename5}')

def reading_from_string6():
    audio_created6 = gTTS(text=text_to_read6, lang=language,
                         slow=slow_audio_speed)
    audio_created6.save(filename6)

    os.system(f'start {filename6}')
def reading_from_string11():
    audio_created11 = gTTS(text=text_to_read11, lang=language,
                         slow=slow_audio_speed)
    audio_created11.save(filename11)

    os.system(f'start {filename11}')

def reading_from_string12():
audio_created12 = gTTS(text=text_to_read12, lang=language,
                     slow=slow_audio_speed)
audio_created12.save(filename12)

os.system(f'start {filename12}')

f=open('name.txt','r+')
x=f.read()
f.close()
answer = input (reading_from_string())
if answer == x :
    text_to_read11 = "Hello again"
    reading_from_string11()
    f=open('name.txt','r')
    g=f.read()
    text_to_read12 = g
    time.sleep(0.5)
    reading_from_string12()
    f.close()


else:
    name=answer
    f=open('name.txt', 'w')
    f.write(name)
    f.close()
    text_to_read2 = 'Hello'
    reading_from_string2()
    text_to_read3 = (name)
    time.sleep(0.5)
    reading_from_string3()
    text_to_read4= 'What do you like'
    text_to_read6 = input (reading_from_string4())
    y=open('likes.txt','w')
    x=text_to_read6
    y.write(x)
    y.close()
    text_to_read5 = 'storing memory'
    reading_from_string5()
    time.sleep(1)
    reading_from_string6()

By the way, it goes straight from text_to_read6 to text_to_read11 because I deleted an unnecessary chunk of code.顺便说一句,它直接从 text_to_read6 到 text_to_read11 因为我删除了不必要的代码块。

Here are the files it opens reads and writes in:以下是它打开读取和写入的文件:

image图片

Here's the error the code produces (after it says none is where i input and when it says sh: 1: start: not found is where it should speak using the gTTS module which i installed using pip3 install gTTS)这是代码产生的错误(在它说 none 是我输入的地方,当它说 sh: 1: start: not found 是它应该使用我使用 pip3 install gTTS 安装的 gTTS 模块说话的地方)

sh: 1: start: not found
Nonearthur
sh: 1: start: not found
sh: 1: start: not found
sh: 1: start: not found
Nonephysics maths and piano
sh: 1: start: not found
sh: 1: start: not found

Do you know what is wrong and how i can fix it?你知道什么是错的,我该如何解决?

Thanks.谢谢。

The error is caused by start not being a command on the operating system you're trying to run your script on.该错误是由于start不是您尝试运行脚本的操作系统上的命令引起的。 start is only available under cmd.exe on Windows. start仅在cmd.exe上的 cmd.exe 下可用。

On raspbian you can use omxplayer --no-keys <filename> instead .raspbian 上,您可以改用omxplayer --no-keys <filename>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM