twmeggs / anfis

Python implementation of an Adaptive neuro fuzzy inference system
MIT License
201 stars 108 forks source link

No module named 'membership' #4

Open JCirera opened 6 years ago

JCirera commented 6 years ago

I installed the anfis package using anaconda prompt and pip. I am using python 3.6 and the error that appears is: "ModuleNotFoundError: No module named 'membership'".

What could be happening?

Thanks in advance!

PD: the membership folder is inside the anfis folder and contains all the functions. Furthermore, the anfis package is inside the anaconda lib folder.

kurianbenoy commented 5 years ago

I also had the same issue

alisikandarkhan commented 5 years ago

actually it can not import hole file .. due to lack of coding..so you have to copy membership file from membership folder and have to paste in main folder of anfis.. then run it ...

Uditi5 commented 5 years ago

Ok so this is how it worked for me import anfis

Copy+paste membershipfunction and mfDerivs in the main anfis folder

In the anfis folder -> init.py remove "from membership import membershipfunction" and "from membership import mfDerivs" Subsequently in anfis.py import membershipfunction

This should work

Uditi5 commented 5 years ago

Yeah that's because of the python version So edit the files in the membership folder

Dr-Ehsan commented 5 years ago

Actually I did these stage and run it on ipython:

  1. copy membershipfunction and mfDrivs files from membership folder and have to paste in main folder of anfis.
  2. import anfis
  3. Instead of "import membership" you have to write "from anfis import membership" These are working on python 2

Anfis

RaiderYi commented 5 years ago

same issue- I am trying to deal with it on Python3

RaiderYi commented 5 years ago

Ok so this is how it worked for me import anfis

Copy+paste membershipfunction and mfDerivs in the main anfis folder

In the anfis folder -> init.py remove "from membership import membershipfunction" and "from membership import mfDerivs" Subsequently in anfis.py import membershipfunction

This should work

could you run the tests.py?

tsorewilly commented 4 years ago

Can you kindly explain this Loc?

mf = [[['gaussmf',{'mean':0.,'sigma':1.}],['gaussmf',{'mean':-1.,'sigma':2.}],['gaussmf',{'mean':-4.,'sigma':10.}],['gaussmf',{'mean':-7.,'sigma':7.}]], [['gaussmf',{'mean':1.,'sigma':2.}],['gaussmf',{'mean':2.,'sigma':3.}],['gaussmf',{'mean':-2.,'sigma':10.}],['gaussmf',{'mean':-10.5,'sigma':5.}]]]

elihek commented 4 years ago

i need help in that. i just copied the membershipfunction.py and mfDerivs.py from the member-folder to the anfis-folder, removed in the anfis-init everything expect import anfis, and in the anfis.py i wrote import membershipfunction and import mfDerivs. Now i can import anfis correctly, but i cannot use the membershipfunction as MemFuncs or as membershipfunction() or as anfis.member...() or as anfis.MemFuns(). How can i do that?

Dr-Ehsan commented 4 years ago

HiPls do the instruction step by step in my github. Its finally work. Its for long time ago and I dont use python 2 for running the Anfis model. May be your issue is about expire the python 2. Fatemi Seyed Ehsan Assistant Professor at Razi University, Water Engineering Department, Kermanshah, Iran. P.O. box, 6715685438  Fax: +98 (0)831 8323727

On Friday, May 8, 2020, 04:59:51 PM GMT+4:30, elihek <notifications@github.com> wrote:  

i need help in that. i just copied the membershipfunction.py and mfDerivs.py from the member-folder to the anfis-folder, removed in the anfis-init everything expect import anfis, and in the anfis.py i wrote import membershipfunction and import mfDerivs. Now i can import anfis correctly, but i cannot use the membershipfunction as MemFuncs or as membershipfunction() or as anfis.member...() or as anfis.MemFuns(). How can i do that?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

elihek commented 4 years ago

Hi Dr. Ehsan,I am using Python 3 and your Step by Step guide does not work for it. If i do the steps and than from anfis import membershipfunction the error "no Module error" Occurs so i need help

Dr-Ehsan commented 4 years ago

HiThis package is using paython 2. It means that its not working in python 3 environment. Use these:anfis.membership.membershipfunction.MemFuncs(mf)

anfis.anfis.ANFIS(X, Y, mfc) You should add extra anfis before the commandGood lock Fatemi Seyed Ehsan Assistant Professor at Razi University, Water Engineering Department, Kermanshah, Iran. P.O. box, 6715685438  Fax: +98 (0)831 8323727

On Friday, May 8, 2020, 11:21:51 PM GMT+4:30, elihek <notifications@github.com> wrote:  

Hi Dr. Ehsan,I am using Python 3 and your Step by Step guide does not work for it. If i do the steps and than from anfis import membershipfunction the error "no Module error" Occurs so i need help

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Dr-Ehsan commented 4 years ago

HiUse:From anfis.membership import mem.... Fatemi Seyed Ehsan Assistant Professor at Razi University, Water Engineering Department, Kermanshah, Iran. P.O. box, 6715685438  Fax: +98 (0)831 8323727

On Friday, May 8, 2020, 11:21:51 PM GMT+4:30, elihek <notifications@github.com> wrote:  

Hi Dr. Ehsan,I am using Python 3 and your Step by Step guide does not work for it. If i do the steps and than from anfis import membershipfunction the error "no Module error" Occurs so i need help

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

elihek commented 4 years ago

I solved my problem just by building a new Python 2-environment, so everything goes good now. Thanks a lot!

mujibluth commented 3 years ago

solved. simply, you have to add the following file (https://github.com/twmeggs/anfis/tree/master/anfisl) in your repository. Have a nice day

anshikakankane commented 3 years ago

this repository is empty so can you please tell me how to solve it? i need help in that. i just copied the membershipfunction.py and mfDerivs.py from the member-folder to the anfis-folder, removed in the anfis-init everything expect import anfis, and in the anfis.py i wrote import membershipfunction and import mfDerivs. Now i can import anfis correctly, but i cannot use the membershipfunction as MemFuncs or as membershipfunction() or as anfis.member...() or as anfis.MemFuns(). and now I am trying to write From anfis.membership import mem....

Also, What if I don’t wanna work with python 2?

mjdutse commented 3 years ago

Hi All, is there any Update of ANFIS for PYTHON3, or is there any link that i can get ANFIS code for python 3 thanks.

gralph92 commented 2 years ago

for python 3, copying the membershipfunction.py and mfDerivs.py from the member-folder to the anfis-folder, removed in the anfis-init everything expect import anfis, and in the anfis.py i wrote import membershipfunction and import mfDerivs and using the following:

import anfis from anfis import membershipfunction, mfDerivs import numpy

it worked for me

tingfeng0303 commented 2 years ago

I copied the two sub-programs of membership directly into anfis.py and then deleted membersfunction and mfDerivs, and finally invoked them with the following program

from anfis.anfis import MemFuncs, ANFIS....

annakorotysheva commented 1 year ago

For python 3, just add a dot before each ‘membership’ in the file init.py located in the anfis folder, so that it becomes:

import anfis from .membership import membershipfunction from .membership import mfDerivs

So you don't need to move files.

orvisZhou commented 1 year ago

hey,sir.could you give me a email?I want to ask the steps in detail about installing the anfis on python3.I'm not a cs student,needing help.