watchdog: 'pip install watchdog' fails on macOS 10.15.2 Catalina

pip install watchdog fails after I upgraded to macOS 10.15.2 with this error:

    Complete output (202 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-3.5
    creating build/lib.macosx-10.14-x86_64-3.5/watchdog
    copying src/watchdog/watchmedo.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
    copying src/watchdog/version.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
    copying src/watchdog/events.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
    copying src/watchdog/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog
    creating build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/unicode_paths.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/compat.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/win32stat.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/dirsnapshot.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/delayed_queue.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/platform.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/bricks.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    copying src/watchdog/utils/echo.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/utils
    creating build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/fsevents.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/inotify.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/api.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/inotify_buffer.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/winapi.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/read_directory_changes.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/kqueue.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/inotify_c.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/polling.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    copying src/watchdog/observers/fsevents2.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/observers
    creating build/lib.macosx-10.14-x86_64-3.5/watchdog/tricks
    copying src/watchdog/tricks/__init__.py -> build/lib.macosx-10.14-x86_64-3.5/watchdog/tricks
    running egg_info
    writing top-level names to src/watchdog.egg-info/top_level.txt
    writing requirements to src/watchdog.egg-info/requires.txt
    writing src/watchdog.egg-info/PKG-INFO
    writing entry points to src/watchdog.egg-info/entry_points.txt
    writing dependency_links to src/watchdog.egg-info/dependency_links.txt
    reading manifest file 'src/watchdog.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.h' under directory 'src'
    writing manifest file 'src/watchdog.egg-info/SOURCES.txt'
    running build_ext
    building '_watchdog_fsevents' extension
    creating build/temp.macosx-10.14-x86_64-3.5
    creating build/temp.macosx-10.14-x86_64-3.5/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -DWATCHDOG_VERSION_STRING="0.10.0" -DWATCHDOG_VERSION_MAJOR=0 -DWATCHDOG_VERSION_MINOR=10 -DWATCHDOG_VERSION_BUILD=0 -I/Users/ericvanegmond/.pyenv/versions/3.5.3/include/python3.5m -c src/watchdog_fsevents.c -o build/temp.macosx-10.14-x86_64-3.5/src/watchdog_fsevents.o -std=c99 -pedantic -Wall -Werror -Wextra -fPIC -Wno-error=unused-command-line-argument
    In file included from src/watchdog_fsevents.c:22:
    In file included from /Users/ericvanegmond/.pyenv/versions/3.5.3/include/python3.5m/Python.h:25:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:64:
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:137:9: error: type nullability specifier '_Nullable' is a Clang extension [-Werror,-Wnullability-extension]
            int     (* _Nullable _close)(void *);
                       ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:93:16: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
            unsigned char   *_base;
                            ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:93:16: note: insert '_Nullable' if the pointer may be null
            unsigned char   *_base;
                            ^
                              _Nullable
.
.
.
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:391:44: note: insert '_Nullable' if the pointer may be null
                     fpos_t (* _Nullable)(void *, fpos_t, int),
                                               ^
                                                _Nullable
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:391:44: note: insert '_Nonnull' if the pointer should never be null
                     fpos_t (* _Nullable)(void *, fpos_t, int),
                                               ^
                                                _Nonnull
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:392:25: error: type nullability specifier '_Nullable' is a Clang extension [-Werror,-Wnullability-extension]
                     int (* _Nullable)(void *));
                            ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------

Any suggestions on how to resolve this? So far I’ve tried removing and reinstalling both xcode and command line tools which hasn’t helped. Not sure what else to try here.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 23

Most upvoted comments

Thanks for your continuous effort, @BoboTiG!

I tested f87d1cf3eb79c308ff7b8eca8cc74ad51385f58d and everything is working fine! 👍

Obtaining file:///Users/keimlink/projects/watchdog
Collecting pathtools>=0.1.1 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/e7/7f/470d6fcdf23f9f3518f6b0b76be9df16dcc8630ad409947f8be2eb0ed13a/pathtools-0.1.2.tar.gz
Collecting pyobjc-framework-Cocoa>=4.2.2 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/7f/fa/5b2f6ae289e98471676dde3887b7d78f5166cbd7bd99943506abd76b2bd0/pyobjc_framework_Cocoa-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Collecting pyobjc-framework-FSEvents>=4.2.2 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/1f/2c/18237d753ca6a4f6e09e043941aafd244c047c27dfd544e8dd1a71d800eb/pyobjc_framework_FSEvents-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Collecting PyYAML>=3.10 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/3d/d9/ea9816aea31beeadccd03f1f8b625ecf8f645bd66744484d162d84803ce5/PyYAML-5.3.tar.gz
Collecting argh>=0.24.1 (from watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/06/1c/e667a7126f0b84aaa1c56844337bf0ac12445d1beb9c8a6199a7314944bf/argh-0.26.2-py2.py3-none-any.whl
Collecting pyobjc-core>=6.1 (from pyobjc-framework-Cocoa>=4.2.2->watchdog==0.10.1)
  Using cached https://files.pythonhosted.org/packages/73/2c/e90c0bb97a455bfe1ec7f8ad6ddfdd8fe55ece448566487242354a4401f6/pyobjc_core-6.1-cp38-cp38-macosx_10_9_x86_64.whl
Installing collected packages: pathtools, pyobjc-core, pyobjc-framework-Cocoa, pyobjc-framework-FSEvents, PyYAML, argh, watchdog
  Running setup.py install for pathtools ... done
  Running setup.py install for PyYAML ... done
  Running setup.py develop for watchdog
Successfully installed PyYAML-5.3 argh-0.26.2 pathtools-0.1.2 pyobjc-core-6.1 pyobjc-framework-Cocoa-6.1 pyobjc-framework-FSEvents-6.1 watchdog

This is the output of ./.venv/bin/watchmedo --help:

usage: watchmedo [-h] [--version] {tricks-from,tricks,tricks-generate-yaml,generate-tricks-yaml,log,shell-command,auto-restart} ...

positional arguments:
  {tricks-from,tricks,tricks-generate-yaml,generate-tricks-yaml,log,shell-command,auto-restart}
    tricks-from (tricks)
                        Subcommand to execute tricks from a tricks configuration file. :param args: Command line argument options.
    tricks-generate-yaml (generate-tricks-yaml)
                        Subcommand to generate Yaml configuration for tricks named on the command line. :param args: Command line argument options.
    log                 Subcommand to log file system events to the console. :param args: Command line argument options.
    shell-command       Subcommand to execute shell commands in response to file system events. :param args: Command line argument options.
    auto-restart        Subcommand to start a long-running subprocess and restart it on matched events. :param args: Command line argument options.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>.
Copyright 2012 Google, Inc.

Licensed under the terms of the Apache license, version 2.0. Please see
LICENSE in the source code for more information.

OK, I removed -Werror completely, there is no way we lost more time on that … Do you confirm this is fixed now? (And so sorry for taking so much of your times.)

OK we will finally get that fixed! Please, tell me that this is fixed on the fix-use-sys-platform branch 🤞 (I force pushed)

The release 0.10.1 is out 😃

I love when it works so smoothly 😃 Thanks a lot. Now we are finally ready for a bugfix release.

@BoboTiG I tested as well and it resolves the issues I was having. Thank you!!!

Ah that is an excellent news, thanks @keimlink !

I orce-pushed on the same branch. Could you have another try please? Sorry to ask you that 😃

I wonder why this is the first time someone reports those issues 🤔

350d9f46720337fb197aaeb30884239cba2dc6d7 is part of #467, which is part of release 0.10.0.

So I would guess that before 0.10.0 -Werror wasn’t used, so these warnings were not enabled.

I will simply fix the code, thanks for the report @keimlink 😃