0

I'm novice in python. I use anaconda Jupiter Notebook, i'm trying to use a module named weka, i installed it with pip. But now I find this error:

File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2961, in run_code exec(code_obj, self.user_global_ns, self.user_ns)

File "", line 14, in from weka.classifiers import Classifier, Evaluation, PredictionOutput

File "C:\ProgramData\Anaconda3\lib\site-packages\weka\classifiers.py", line 2169 except Exception, e: ^ SyntaxError: invalid syntax

Somebody can help me? guess is a stupid error, but i can't solve it..

3
  • 2
    You seems to use a Python 2 only library on Python 3. Commented Oct 21, 2018 at 9:20
  • How have you come to that conclusion @Klaus D. I'm sorry but there is nowhere that say he is using Python 2.x, infact, I'm sure he is using Python 3.x because of the Anaconda version he is using. To the OP:Have you ever used Pycharm? You should check it out. Commented Oct 21, 2018 at 9:24
  • 2
    except Exception, e: is Python 2 syntax. Commented Oct 21, 2018 at 9:59

1 Answer 1

1

You may want to upgrade weka. In the current version of classifiers.py, the except ... as ...: lines are Python3 compatible.

But it does appear that the fixes in the current codebase are not on pypi so you'll probably need to install from source. See this guide for how you could do that. And perhaps post an issue about it on the GitHub repo.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.