【问题标题】:Python saying "no module named tflearn" but i imported itPython 说“没有名为 tflearn 的模块”,但我导入了它
【发布时间】:2019-08-13 17:53:47
【问题描述】:

我使用 Pip install TFlearn 并在我的 Raspberry Pi 上运行我的代码,但它显示

没有名为 tflearn 的模块

视频:https://www.youtube.com/watch?v=wypVcNIH6D4&t=3s

代码:

import nltk 
from nltk.stem.lancaster import LancasterStemmer
stemmer =  LancasterStemmer()

import numpy
import tflearn
import tensorflow
import random
import json

{"intents": [
        {"tag": "greeting",
         "patterns": ["Hi", "How are you", "Is anyone there?", "Hello", "Good day", "Whats up"],
         "responses": ["Hello!", "Good to see you again!", "Hi there, how can I help?"],
         "context_set": ""
        },
        {"tag": "goodbye",
         "patterns": ["cya", "See you later", "Goodbye", "I am Leaving", "Have a Good day"],
         "responses": ["Sad to see you go :(", "Talk to you later", "Goodbye!"],
         "context_set": ""
        },
        {"tag": "age",
         "patterns": ["how old", "how old is tim", "what is your age", "how old are you", "age?"],
         "responses": ["I am 18 years old!", "18 years young!"],
         "context_set": ""
        },
        {"tag": "name",
         "patterns": ["what is your name", "what should I call you", "whats your name?"],
         "responses": ["You can call me Tim.", "I'm Tim!", "I'm Tim aka Tech With Tim."],
         "context_set": ""
        },
        {"tag": "shop",
         "patterns": ["Id like to buy something", "whats on the menu", "what do you reccommend?", "could i get something to eat"],
         "responses": ["We sell chocolate chip cookies for $2!", "Cookies are on the menu!"],
         "context_set": ""
        },
        {"tag": "hours",
         "patterns": ["when are you guys open", "what are your hours", "hours of operation"],
         "responses": ["We are open 7am-4pm Monday-Friday!"],
         "context_set": ""
        }
   ]
}

【问题讨论】:

  • 你如何运行你的代码?您是在命令行中输入python myscript.py,还是使用IDE 或其他方式?
  • 我确实 pip install tflearn
  • 这就是你安装 tflearn 包的方式,但我问你是如何运行你的代码

标签: python tensorflow raspberry-pi tflearn


【解决方案1】:

基本初步检查: 跑 pip freeze 获取已安装软件包的列表。理想情况下 tflearn 应该在那里。如果不是,则说明包没有正确安装。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-09
    • 1970-01-01
    • 2016-12-30
    • 1970-01-01
    • 2020-07-11
    • 1970-01-01
    • 2016-01-15
    • 2019-10-19
    相关资源
    最近更新 更多