fabianvf / python-rake

MIT License
130 stars 35 forks source link

Import error under Python 3.5 #2

Closed 13tales closed 8 years ago

13tales commented 8 years ago

Hi there. I'm new to Python, and was hoping to use this module for a prototype I'm working on. Unortunately, after installing with Pip, I get this error in the interpreter when trying to import:

import RAKE Traceback (most recent call last): File "", line 1, in File "/Users/13tales/notesproto/lib/python3.5/site-packages/RAKE/init.py", line 1, in from RAKE import Rake ImportError: cannot import name 'Rake'

Any suggestions on how I can resolve this?

be-ndee commented 8 years ago

Currently had the same error. If I change from RAKE import Rake to from RAKE.RAKE import Rake then it works. No clue if it's working in python versions less than 3.5... But I will try it out now ;)

be-ndee commented 8 years ago

If I wrap the import with an try-except it works. Have created a pull request for this.

tomaspinho commented 8 years ago

Hello, sorry for the delay answering this issue.

This module was developed and tested in python 2.7. I'll check the PR and confirm it works on both versions. Will merge if so.

tomaspinho commented 8 years ago

Previous version:

Working in python2.7: Python 2.7.11 (default, Dec 6 2015, 15:43:46) [GCC 5.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import RAKE

Not working under python3.5: Python 3.5.1 (default, Dec 7 2015, 12:58:09) [GCC 5.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import RAKE Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/site-packages/RAKE/init.py", line 1, in from RAKE import Rake ImportError: cannot import name 'Rake'

PR version: Working under python2.7: Python 2.7.11 (default, Dec 6 2015, 15:43:46) [GCC 5.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import RAKE

Working under python3.5: Python 3.5.1 (default, Dec 7 2015, 12:58:09) [GCC 5.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import RAKE

Merged.

be-ndee commented 8 years ago

:+1: