为什么Python模块在命令行中不起作用?

我的笔记本电脑中安装了Python 3.8.2。我安装了各种模块并将其导入下面的代码中。

 import wikipediaapi
    from gtts import gTTS
    import speech_recognition as sr
    import os
    import datetime
    import calendar
    import warnings
    import random
    # ignore any warnings
warnings.filterwarnings('ignore')


# audio -> command -> response (text) -> response (speech)

# records audio and return it as string

def recordAudio():
    r = sr.Recognizer  # creating a recognizer object

    # open the mic
    with sr.Microphone() as src:
        print('say something!')
        audio = r.listen(self=None, source=src, timeout=None, phrase_time_limit=None, snowboy_configuration=None)

    # use google speech recog

    data = ''
    try:
        r.recognize_google(self=None, audio_data=audio, key=None, language='en', show_all=False)
        print('You said: ' + data)
    except sr.UnknownValueError as s:
        print('Your audio could not be recognized' + s)
    except sr.RequestError as e:
        print('Request results from Google Speech Recog error' + e)

    return data


def assistantResponse(string):
    print(string)
    myObj = gTTS(text=string, lang='en, fr', slow=False)

    # save the converted audio to file.

    myObj.save('assistant_response.mp3')

    # Play the file
    os.system('start assistant_response.mp3')


# A function for wake word(s) or phrase
def wakeWord(string):
    WAKE_WORDS = ['hey Apoorva', 'okay Apoorva']  # A list of wake words

    text = string.lower()

    for phrase in WAKE_WORDS:
        if phrase in text:
            return True

    # IF wake word isn't found in the text, comp returns false.
    return False

    # A function to reutrn the current date


def getDate():
    now = datetime.datetime.now()
    my_date = datetime.datetime.today()
    weekday = calendar.day_name[my_date.weekday()]
    monthNum = now.month
    dayNum = now.day

    # a list of months

    month_names = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August',
                   'September', 'October', 'November', 'December']

    return 'Today is ' + month_names[monthNum - 1], ', ' + dayNum, 'st, ' + weekday


def greetingUser(string):
    GREETINGS_INPUT = ['hello', 'hola', 'hi', 'greetings', 'wassup']
    GREETINGS_OUTPUT = ['hello, matey!', 'oh hi!', 'hey there!']

    if GREETINGS_INPUT in string:
        rando = random.randint(0, 2)
        return GREETINGS_OUTPUT[rando]


def wikiSearch(string):
    wordList = string.split()

    for i in range(0, len(wordList)):
        if i + 3 <= len(wordList) - 1 and wordList[i].lower() == 'who' or 'what' and wordList[i + 1].lower() == 'is':
            return wordList[i + 2] + ' ' + wordList[i + 3]


while True:

    # Record Audio
    text = recordAudio()
    response = ''

    # Check fro wake word/phrase

    if (wakeWord(text)) == True:

        response = response + greetingUser(text)

        if ('date' in text):
            get_date = getDate()
            response = response + ' ' + get_date

        if ('who is' or 'what is' in text):
            person = wikiSearch(text)
            wiki = wikipedia.summary(person, sentences=2)
            response = response + ' ' + wiki

            assistantResponse(response)

当我尝试在cmd中执行python函数时,它显示以下错误: 第1行,在     导入维基百科 ImportError:没有名为Wikipediaapi的模块

当我用Wikipedia替换它时,它显示了相同的内容,也显示了gtts模块。 请帮忙。 提前致谢