acoomans / flask-autodoc

Flask autodoc automatically creates an online documentation for your flask application.
MIT License
98 stars 49 forks source link

Cannot import for python 3 #18

Open dridk opened 9 years ago

dridk commented 9 years ago

I installed Flask-Autodoc (0.1.1) like all my packages using : pip install flask-autodoc and python3

When I tried to import Flask-Autodoc , I get this following error :

   In [4]: from flask.ext.autodoc import Autodoc
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-4-b490edb37e00> in <module>()
----> 1 from flask.ext.autodoc import Autodoc

/Users/sacha/dev/wingo-server/venv/lib/python3.4/site-packages/flask/exthook.py in load_module(self, fullname)
     79                 # is the one from __import__ above which we don't care about
     80                 if self.is_important_traceback(realname, tb):
---> 81                     reraise(exc_type, exc_value, tb.tb_next)
     82                 continue
     83             module = sys.modules[fullname] = sys.modules[realname]

/Users/sacha/dev/wingo-server/venv/lib/python3.4/site-packages/flask/_compat.py in reraise(tp, value, tb)
     30     def reraise(tp, value, tb=None):
     31         if value.__traceback__ is not tb:
---> 32             raise value.with_traceback(tb)
     33         raise value
     34 

/Users/sacha/dev/wingo-server/venv/lib/python3.4/site-packages/flask_autodoc/__init__.py in <module>()
      1 __author__ = 'arnaud'
----> 2 from autodoc import Autodoc

ImportError: No module named 'autodoc'
theodickson commented 9 years ago

Same exact issue here, also using 3.4

lukeyeager commented 9 years ago

Works for me. Here's what I did:

virtualenv -p python3 venv
source venv/bin/activate
pip install Flask-Autodoc
python -c "from flask.ext.autodoc import Autodoc"

Here's how to check whether you installed a python2 package instead of a python3 package:

$ pip --version
pip 1.5.4 from /.../venv/lib/python3.4/site-packages (python 3.4)

$ pip list | grep -i flask
Flask (0.10.1)
Flask-Autodoc (0.1.2)
protoforge commented 8 years ago

Just to chime in - This seems broken in Python 3.4 for me as well.

Anyone have a fix?

This seems like a great tool - any way of getting it repaired and added to the 'approved' flask registry? http://flask.pocoo.org/extensions/

sallyruthstruik commented 7 years ago

I faced with this problem too.

This pull request should fix this problem: https://github.com/acoomans/flask-autodoc/pull/25 Or you can manually replace line --- from flask_autodoc.autodoc import Autodoc +++ from .autodoc import Autodoc

in flask_autodoc.init.py

pintman commented 3 years ago

Same problem here. Further: no update on this issue for years. :(