Repository navigation
AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier' #1106
Description
Activity
Which versions of
livereloadandtornadodo you have?Perhaps you can try updating them to the latest versions:
pip install -U tornado livereloadI have livereload 2.5.0 and tornado 4.4.2, both installed locally for my user.
pip install -Utells me both are up-to-date.I can't reproduce this locally. I wonder if this is a Python 2.6 incompatibility. I don't have that installed locally so I can't test this myself and our automated tests aren't having any problem, although they don't necessarily test the third party libs we use.
As a test, let's see if livereload is working on its own by manually building the site and using livereload directly. Try the following commands:
mkdocs build cd site livereloadIf that raises the same error, then the problem is upstream. If not, then we have a problem with MkDocs use of livereload.
As an aside, using livereload like that won't work the same as using our wrapper. You would still need to
buildmanually every time. With our wrapper, the builds are automated too.- I think either livereload or tornado (or both?) dropped support for Python 2.6 some time ago. I think we also did, but I'm not sure if we broke anything in the process. On Wed, Dec 7, 2016 at 2:50 AM +0000, "Waylan Limberg" <notifications@github.com> wrote: I can;t reproduce this locally. I wonder if this is a Python 2.6 incompatibility. I don't have that installed locally so I can't test this myself and our automated tests aren't having any problem, although they don't necessarily test the third party libs we use. As a test, let's see if livereload is working on its own by manually building the site and using livereload directly. Try the following commands: mkdocs build cd site livereload If that raises the same error, then the problem is upstream. If not, then we can a problem with MkDocs use of livereload. As an aside, using livereload like that won't work the same as using our wrapper. You would still need to build manually every time. With our wrapper, the builds are automated too. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
- I tried quickly on Python2.6 and nothing works for me. python-markdown uses importlib which isn't installed. Installing the backport gets you slightly further, but we use OrderedDict from collections - so that fails too. There isn't a simple backport for this, as we import it from collections. If we used the OrderedDict package that would solve it. I didn't investigate any further. I think we need to remove this warning and change it to an error now: https://github.com/mkdocs/mkdocs/blob/master/mkdocs/__init__.py#L8-L10 and also remove 2.6 from the setup.py On 7 December 2016 at 08:44, Dougal Matthews <dougal@dougalmatthews.com> wrote:…I think either livereload or tornado (or both?) dropped support for Python 2.6 some time ago. I think we also did, but I'm not sure if we broke anything in the process. On Wed, Dec 7, 2016 at 2:50 AM +0000, "Waylan Limberg" < ***@***.***> wrote: I can;t reproduce this locally. I wonder if this is a Python 2.6 > incompatibility. I don't have that installed locally so I can't test this > myself and our automated tests aren't having any problem, although they > don't necessarily test the third party libs we use. > > As a test, let's see if livereload is working on its own by manually > building the site and using livereload directly. Try the following commands: > > mkdocs buildcd site > livereload > > If that raises the same error, then the problem is upstream. If not, then > we can a problem with MkDocs use of livereload. > > As an aside, using livereload like that won't work the same as using our > wrapper. You would still need to build manually every time. With our > wrapper, the builds are automated too. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <#1106 (comment)>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AAC8U-_Sb3E6bDn9M7HxwNa6QzjT7_-uks5rFh7jgaJpZM4LFEXQ> > . >
Travis is still running the PY2.6 tests so I assumed it still works. I realize Python-Markdown dropped support some time ago but I assumed MkDocs still worked with an older version. Perhaps the few untested areas are the problem.
In fact I ran into a few problems with 2.6 tests failing (which I was able to resolve) when trying to get 0.16 out the door. I'm happy to see it go. Just didn't think we were there yet.
That is a good point, I forgot Travis covered this - maybe I done something wrong with my test. I'll try again tomorrow.
The plan was to drop it for 1.0 anyway, so we can do that soon. Seems 0.16 is pretty solid - maybe we just do a quick release with the couple of bug fixes and then start the cleanup?
The plan was to drop it for 1.0 anyway, so we can do that soon. Seems 0.16 is pretty solid - maybe we just do a quick release with the couple of bug fixes and then start the cleanup?
That was my thinking as well.
I am hitting this... is there an easy fix?
I'm on Python 2.7.3 (default, Jun 22 2015, 19:33:41)
[GCC 4.6.3] on linux2and if it helps I tried
mkdocs build cd /home/erich/civicrm-dev-docs/site livereloadand got a similar error:
[I 170106 22:02:35 server:283] Serving on http://127.0.0.1:35729 [I 170106 22:02:35 handlers:60] Start watching changes Traceback (most recent call last): File "/usr/local/bin/livereload", line 9, in <module> load_entry_point('livereload==2.5.0', 'console_scripts', 'livereload')() File "/usr/local/lib/python2.7/dist-packages/livereload/cli.py", line 39, in main server.serve(host=args.host, port=args.port, root=args.directory) File "/usr/local/lib/python2.7/dist-packages/livereload/server.py", line 300, in serve LiveReloadHandler.start_tasks() File "/usr/local/lib/python2.7/dist-packages/livereload/handlers.py", line 61 , in start_tasks if not cls.watcher.start(cls.poll_tasks): File "/usr/local/lib/python2.7/dist-packages/livereload/watcher.py", line 160 , in start self.notifier = pyinotify.TornadoAsyncNotifier( AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'related issue: clonn/simple-livereload#1
ok so I've fixed this on my machine with
sudo pip install pyinotify --upgrade(was on
pyinotify==0.9.2not onpyinotify==0.9.6)related issue: clonn/simple-livereload#1
Hmm, interesting as that is the Node/JavaScript livereload lib. Regardless, thanks for the workaround (upgrading pyinotify) @ErichBSchulz. Turns out that lepture/python-livereload requires at least
pyinotify=>0.9.4.In an effort to track this down, I noticed that pyinotify is not listed as a dependency of either lepture/python-livereload or its dependencies. In fact, it isn't even installed on my virtualenvs (I checked with
pip freeze). But, with a little digging, I see that the import fails gracefully and a different code-path is followed when the lib is not installed.pyinotify is a Linux-specific lib and not available on other platforms (thus python-livereload's graceful fallback). In fact, I haven't noticed any issues with it not being installed on my local Linux system. That said, it is a wrapper around the inotify lib and is likely much more performant than the home-grown system for other platforms. We can't expect users to not have it installed, and there is no reasonable way to force users who do to upgrade (if needed) when python-livereload is installed.
Regardless, this should be an upstream issue for python-livereload. lepture/python-livereload#143 already raises the issue that pyinotify support is not documented. I opened lepture/python-livereload#148 to add a check for the pyinotify version and fallback gracefully if an older version is installed.
Once that (or a similar fix) gets accepted and included in a new version of python-livereload, we can update our version requirement for that lib. Until then, we'll leave this open to remind us.
@waylan A new version of livereload is released.
@lepture awesome! Thanks.
- added a commit that references this issue
on Jan 8, 2017 - added a commit that references this issue
on Jan 8, 2017
Using Python 2.6.6 on CentOS, I'm unable to run the server with livereload:
I can workaround by using
--no-livereload, but is there a way to get livereload working?