3

I made a traffic light prototype from raspi. My source code has given an error. The erorr said

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

I already checked that scikit-fuzzy has been installed on my raspi, but whenever i run, the source can not recognize that scikit-fuzzy tools.

here is my some of source code:

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)
Himawan Sandhi
  • 51
  • 1
  • 2
  • 6
  • How have you installed the skfuzzy? – Vivek Kumar Jan 12 '18 at 05:30
  • I followed all the instructions from here: http://pythonhosted.org/scikit-fuzzy/install.html and https://scikits.appspot.com/scikit-fuzzy everytime I repeat the installation, the system always siad that it's been already installed – Himawan Sandhi Jan 15 '18 at 03:31

3 Answers3

15

For me too, there was same error coming up .

But the command below solved it (Go to command line and type) :

 pip install -U scikit-fuzzy

This should work.

Shalini Baranwal
  • 2,780
  • 4
  • 24
  • 34
1

@ShaliniBaranwal is correct answer

For python3 follow command

sudo pip3 install -U scikit-fuzzy

Also as commented by @hiwansandhi follow instructions on link pythonhosted.org/scikit-fuzzy/install.html and scikits.appspot.com/scikit-fuzzy

These are useful to install scikit-fuzzy using easy_install and pip

sudo pip3 install -U scikit-fuzzy

This also describes how to install from source

git clone http://github.com/scikit-fuzzy/scikit-fuzzy.git

shantanu pathak
  • 2,018
  • 19
  • 26
1

So what worked for me is (I use python3):

pip uninstall scikit-fuzzy scipy numpy networkx decorator

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

Then close and open again the IDE (for me it is Spyder)

help-info.de
  • 6,695
  • 16
  • 39
  • 41
mdev111
  • 11
  • 1