【问题标题】:skfuzzy can not be recognizedskfuzzy 无法识别
【发布时间】:2018-06-18 03:57:19
【问题描述】:

我用 raspi 制作了一个红绿灯原型。我的源代码出错了。错误说

Traceback (most recent call last):
File "/home/pi/testing.py", line 2, in <module>
import skfuzzy as fuzz
ImportError: No module named 'skfuzzy'

我已经检查过 scikit-fuzzy 是否已安装在我的 raspi 上,但是每当我运行时,源都无法识别 scikit-fuzzy 工具。

这是我的一些源代码:

import numpy as np
import skfuzzy as fuzz
import RPi.GPIO as GPIO
import time

Curr_GtGB=40 
Curr_GtSU=46 
Curr_GtSS=26 
Curr_GtK=12 

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)

redGB=16
yelGB=18
grenGB=22

redSU=40
yelSU=38
grenSU=36

redSS=33
yelSS=35
grenSS=37

redK=11
yelK=13
grenK=15

GPIO.setup(redGB, GPIO.OUT)
GPIO.setup(yelGB, GPIO.OUT)
GPIO.setup(grenGB, GPIO.OUT)
GPIO.setup(redSU, GPIO.OUT)
GPIO.setup(yelSU, GPIO.OUT)
GPIO.setup(grenSU, GPIO.OUT)
GPIO.setup(redSS, GPIO.OUT)
GPIO.setup(yelSS, GPIO.OUT)
GPIO.setup(grenSS, GPIO.OUT)
GPIO.setup(redK, GPIO.OUT)
GPIO.setup(yelK, GPIO.OUT)
GPIO.setup(grenK, GPIO.OUT)

【问题讨论】:

标签: python raspberry-pi fuzzy-logic fuzzy


【解决方案1】:

对我来说,也出现了同样的错误。

但是下面的命令解决了它(转到命令行并输入):

 pip install -U scikit-fuzzy

这应该可行。

【讨论】:

    【解决方案2】:

    @ShaliniBaranwal 是正确答案

    对于python3 跟随命令

    sudo pip3 install -U scikit-fuzzy

    正如@hiwansandhi 所评论的,请按照链接 pythonhosted.org/scikit-fuzzy/install.html 和 scikits.appspot.com/scikit-fuzzy 上的说明进行操作

    这些对于使用 easy_install 和 pip 安装 scikit-fuzzy 很有用

    sudo pip3 install -U scikit-fuzzy

    这也描述了如何从源代码安装

    git 克隆http://github.com/scikit-fuzzy/scikit-fuzzy.git

    【讨论】:

      【解决方案3】:

      所以对我有用的是(我使用 python3):

      pip uninstall scikit-fuzzy scipy numpy networkx decorator

      pip3 uninstall scikit-fuzzy scipy numpy networkx decorator 
      pip3 install -U scikit-fuzzy
      

      然后关闭并再次打开 IDE(对我来说是 Spyder)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-10-11
        • 1970-01-01
        • 1970-01-01
        • 2013-04-19
        • 2019-01-28
        • 2017-08-10
        • 2019-11-01
        • 2015-08-14
        相关资源
        最近更新 更多