Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install watchdog failing on macOS 10.15.4 #658

Closed
Geordon opened this issue Apr 13, 2020 · 6 comments
Closed

pip install watchdog failing on macOS 10.15.4 #658

Geordon opened this issue Apr 13, 2020 · 6 comments

Comments

@Geordon
Copy link

Geordon commented Apr 13, 2020

I had initially discovered that I had issues with my Python environment and it was a hot mess. I have since installed pyenv and am working with Python 3.8 I am not able to get watchdog to install. I have removed and reinstalled Xcode and command line tools.

Can someone suggest what's going wrong so that I can hopefully get watchdog installed right?

pip install watchdog
Collecting watchdog
  Using cached watchdog-0.10.2.tar.gz (95 kB)
Requirement already satisfied: pathtools>=0.1.1 in ./.pyenv/versions/3.8.2/lib/python3.8/site-packages (from watchdog) (0.1.2)
Installing collected packages: watchdog
    Running setup.py install for watchdog ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/gvantass/.pyenv/versions/3.8.2/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/gvantass/src/pip-install-vs1biow8/watchdog/setup.py'"'"'; __file__='"'"'/Users/gvantass/src/pip-install-vs1biow8/watchdog/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /Users/gvantass/src/pip-record-yyi9bglh/install-record.txt --single-version-externally-managed --compile --install-headers /Users/gvantass/.pyenv/versions/3.8.2/include/python3.8/watchdog
         cwd: /Users/gvantass/src/pip-install-vs1biow8/watchdog/
    Complete output (79 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.15-x86_64-3.8
    creating build/lib.macosx-10.15-x86_64-3.8/watchdog
    copying src/watchdog/watchmedo.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog
    copying src/watchdog/version.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog
    copying src/watchdog/events.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog
    copying src/watchdog/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog
    creating build/lib.macosx-10.15-x86_64-3.8/watchdog/utils
    copying src/watchdog/utils/unicode_paths.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/utils
    copying src/watchdog/utils/compat.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/utils
    copying src/watchdog/utils/win32stat.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/utils
    copying src/watchdog/utils/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/utils
    copying src/watchdog/utils/dirsnapshot.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/utils
    copying src/watchdog/utils/delayed_queue.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/utils
    copying src/watchdog/utils/platform.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/utils
    copying src/watchdog/utils/bricks.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/utils
    copying src/watchdog/utils/echo.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/utils
    creating build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    copying src/watchdog/observers/fsevents.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    copying src/watchdog/observers/inotify.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    copying src/watchdog/observers/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    copying src/watchdog/observers/api.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    copying src/watchdog/observers/inotify_buffer.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    copying src/watchdog/observers/winapi.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    copying src/watchdog/observers/read_directory_changes.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    copying src/watchdog/observers/kqueue.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    copying src/watchdog/observers/inotify_c.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    copying src/watchdog/observers/polling.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    copying src/watchdog/observers/fsevents2.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/observers
    creating build/lib.macosx-10.15-x86_64-3.8/watchdog/tricks
    copying src/watchdog/tricks/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/watchdog/tricks
    running egg_info
    writing src/watchdog.egg-info/PKG-INFO
    writing dependency_links to src/watchdog.egg-info/dependency_links.txt
    writing entry points to src/watchdog.egg-info/entry_points.txt
    writing requirements to src/watchdog.egg-info/requires.txt
    writing top-level names to src/watchdog.egg-info/top_level.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.15-x86_64-3.8
    creating build/temp.macosx-10.15-x86_64-3.8/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -DWATCHDOG_VERSION_STRING="0.10.2" -DWATCHDOG_VERSION_MAJOR=0 -DWATCHDOG_VERSION_MINOR=10 -DWATCHDOG_VERSION_BUILD=2 -I/Users/gvantass/.pyenv/versions/3.8.2/include/python3.8 -c src/watchdog_fsevents.c -o build/temp.macosx-10.15-x86_64-3.8/src/watchdog_fsevents.o -std=c99 -pedantic -Wall -Wextra -fPIC -Wno-nullability-completeness -Wno-nullability-extension -Wno-newline-eof -Wno-error=unused-command-line-argument
    In file included from src/watchdog_fsevents.c:22:
    In file included from /Users/gvantass/.pyenv/versions/3.8.2/include/python3.8/Python.h:121:
    In file included from /Users/gvantass/.pyenv/versions/3.8.2/include/python3.8/genobject.h:11:
    In file included from /Users/gvantass/.pyenv/versions/3.8.2/include/python3.8/pystate.h:10:
    In file included from /Users/gvantass/.pyenv/versions/3.8.2/include/python3.8/pythread.h:120:
    /usr/local/include/pthread.h:331:6: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
    #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT
         ^
    /usr/local/include/pthread.h:200:2: note: expanded from macro '_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT'
            defined(SWIFT_CLASS_EXTRA) && (!defined(SWIFT_SDK_OVERLAY_PTHREAD_EPOCH) || (SWIFT_SDK_OVERLAY_PTHREAD_EPOCH < 1))
            ^
    /usr/local/include/pthread.h:331:6: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
    /usr/local/include/pthread.h:200:34: note: expanded from macro '_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT'
            defined(SWIFT_CLASS_EXTRA) && (!defined(SWIFT_SDK_OVERLAY_PTHREAD_EPOCH) || (SWIFT_SDK_OVERLAY_PTHREAD_EPOCH < 1))
                                            ^
    /usr/local/include/pthread.h:540:6: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
    #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT
         ^
    /usr/local/include/pthread.h:200:2: note: expanded from macro '_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT'
            defined(SWIFT_CLASS_EXTRA) && (!defined(SWIFT_SDK_OVERLAY_PTHREAD_EPOCH) || (SWIFT_SDK_OVERLAY_PTHREAD_EPOCH < 1))
            ^
    /usr/local/include/pthread.h:540:6: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
    /usr/local/include/pthread.h:200:34: note: expanded from macro '_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT'
            defined(SWIFT_CLASS_EXTRA) && (!defined(SWIFT_SDK_OVERLAY_PTHREAD_EPOCH) || (SWIFT_SDK_OVERLAY_PTHREAD_EPOCH < 1))
                                            ^
    4 warnings generated.
    clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/gvantass/.pyenv/versions/3.8.2/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/gvantass/.pyenv/versions/3.8.2/lib -L/usr/local/opt/openssl/lib:/usr/local/git/bin:/sw/bin/:/usr/local/bin:/usr/local/:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Library/Apple/usr/bin export CPPFLAGS=-I/usr/local/opt/openssl/include:/usr/local/git/bin:/sw/bin/:/usr/local/bin:/usr/local/:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Library/Apple/usr/bin build/temp.macosx-10.15-x86_64-3.8/src/watchdog_fsevents.o -lm -o build/lib.macosx-10.15-x86_64-3.8/_watchdog_fsevents.cpython-38-darwin.so -framework CoreFoundation -framework CoreServices
    clang: error: no such file or directory: 'export'
    clang: error: no such file or directory: 'CPPFLAGS=-I/usr/local/opt/openssl/include:/usr/local/git/bin:/sw/bin/:/usr/local/bin:/usr/local/:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Library/Apple/usr/bin'
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/gvantass/.pyenv/versions/3.8.2/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/gvantass/src/pip-install-vs1biow8/watchdog/setup.py'"'"'; __file__='"'"'/Users/gvantass/src/pip-install-vs1biow8/watchdog/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /Users/gvantass/src/pip-record-yyi9bglh/install-record.txt --single-version-externally-managed --compile --install-headers /Users/gvantass/.pyenv/versions/3.8.2/include/python3.8/watchdog Check the logs for full command output.
@Geordon
Copy link
Author

Geordon commented Apr 19, 2020

Can someone tell me anything about this? I'd love to be able to use watcher...

@devstein
Copy link

@Geordon I'm also facing this issue. Any solutions here?

@devstein
Copy link

devstein commented May 18, 2020

This solution worked for me: #628 (comment)

@ghost
Copy link

ghost commented Jun 5, 2020

If anyone stumbles onto this issue now. The solution for me was to uninstall the homebrew version of gcc with brew uninstall gcc. Then you can do a which gcc and gcc -v to make sure you're using Apple clang.

My error message was different however: no option -Wunused-command-line-argument

@paschalis-mpeis
Copy link

In my case I had installed a really outdated LLVM version with Homebrew:

/usr/local/bin/clang -> /usr/local/Cellar/llvm@4/4.0.1/bin/clang

I removed it using:
brew uninstall llvm@4

Now it picks /usr/bin/clang:

clang --version
Apple clang version 12.0.0 (clang-1200.0.32.2)

Note that the apple v12 has to do with XCode, and not the upstream LLVM version,
which is version 10 as of the time of writing this comment.

PS: this whole compiler toolchains, libraries and headers, that have to go through xcode / xcode command line tools,
is a bit of a mess! :)

@di
Copy link
Contributor

di commented Dec 18, 2020

This should be mostly resolved now that watchdog==1.0.2 provides built distributions, but this will still be a problem for new macOS ARM platforms until #740 is resolved.

@BoboTiG BoboTiG closed this as completed Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants