Error installing streamlit on OS X

Iโ€™m trying to install streamlit for python 3.6 on my 2014 macbook with OS X mojave (10.14.15) and Iโ€™m getting an error when doing pip install streamlit. Any idea how to fix it?

pip install streamlit
Collecting streamlit
  Using cached https://files.pythonhosted.org/packages/d0/99/f8166f0baac96f2ea4d634749331bf78d8830db9991fc8086e828dca8959/streamlit-0.47.4-py2.py3-none-any.whl
Requirement already satisfied: altair>=3.2.0 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (3.2.0)
Requirement already satisfied: astor in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (0.8.0)
Requirement already satisfied: enum-compat in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (0.0.2)
Requirement already satisfied: future in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (0.18.0)
Requirement already satisfied: tzlocal in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (2.0.0)
Requirement already satisfied: protobuf>=3.6.0 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (3.10.0)
Requirement already satisfied: tornado<6.0,>=5.0 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (5.1.1)
Requirement already satisfied: pandas in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (0.25.1)
Requirement already satisfied: pillow!=5.1.0 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (6.2.0)
Requirement already satisfied: botocore in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (1.12.246)
Requirement already satisfied: boto3 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (1.9.246)
Requirement already satisfied: validators in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (0.14.0)
Requirement already satisfied: click>=7.0 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (7.0)
Requirement already satisfied: toml in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (0.10.0)
Requirement already satisfied: base58 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (1.0.3)
Collecting watchdog (from streamlit)
  Using cached https://files.pythonhosted.org/packages/bb/e3/5a55d48a29300160779f0a0d2776d17c1b762a2039b36de528b093b87d5b/watchdog-0.9.0.tar.gz
Requirement already satisfied: blinker in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (1.4)
Requirement already satisfied: numpy in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (1.17.2)
Requirement already satisfied: requests in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from streamlit) (2.22.0)
Requirement already satisfied: toolz in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from altair>=3.2.0->streamlit) (0.10.0)
Requirement already satisfied: six in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from altair>=3.2.0->streamlit) (1.12.0)
Requirement already satisfied: jinja2 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from altair>=3.2.0->streamlit) (2.10.3)
Requirement already satisfied: jsonschema in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from altair>=3.2.0->streamlit) (3.1.1)
Requirement already satisfied: entrypoints in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from altair>=3.2.0->streamlit) (0.3)
Requirement already satisfied: pytz in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from tzlocal->streamlit) (2019.3)
Requirement already satisfied: setuptools in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages/setuptools-40.8.0-py3.6.egg (from protobuf>=3.6.0->streamlit) (40.8.0)
Requirement already satisfied: python-dateutil>=2.6.1 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from pandas->streamlit) (2.8.0)
Requirement already satisfied: urllib3<1.26,>=1.20; python_version >= "3.4" in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from botocore->streamlit) (1.25.6)
Requirement already satisfied: docutils<0.16,>=0.10 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from botocore->streamlit) (0.15.2)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from botocore->streamlit) (0.9.4)
Requirement already satisfied: s3transfer<0.3.0,>=0.2.0 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from boto3->streamlit) (0.2.1)
Requirement already satisfied: decorator>=3.4.0 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from validators->streamlit) (4.4.0)
Requirement already satisfied: PyYAML>=3.10 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from watchdog->streamlit) (5.1.2)
Requirement already satisfied: argh>=0.24.1 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from watchdog->streamlit) (0.26.2)
Requirement already satisfied: pathtools>=0.1.1 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from watchdog->streamlit) (0.1.2)
Requirement already satisfied: idna<2.9,>=2.5 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from requests->streamlit) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from requests->streamlit) (2019.9.11)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from requests->streamlit) (3.0.4)
Requirement already satisfied: MarkupSafe>=0.23 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from jinja2->altair>=3.2.0->streamlit) (1.1.1)
Requirement already satisfied: attrs>=17.4.0 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from jsonschema->altair>=3.2.0->streamlit) (19.2.0)
Requirement already satisfied: pyrsistent>=0.14.0 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from jsonschema->altair>=3.2.0->streamlit) (0.15.4)
Requirement already satisfied: importlib-metadata in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from jsonschema->altair>=3.2.0->streamlit) (0.23)
Requirement already satisfied: zipp>=0.5 in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from importlib-metadata->jsonschema->altair>=3.2.0->streamlit) (0.6.0)
Requirement already satisfied: more-itertools in /Users/biellls/.virtualenvs/streamlit_test/lib/python3.6/site-packages (from zipp>=0.5->importlib-metadata->jsonschema->altair>=3.2.0->streamlit) (7.2.0)
Installing collected packages: watchdog, streamlit
  Running setup.py install for watchdog ... error
    Complete output from command /Users/biellls/.virtualenvs/streamlit_test/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/6k/tmx4rbd56sjggs0mvw4q9xhm0000gn/T/pip-install-g3xkfkuk/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 /private/var/folders/6k/tmx4rbd56sjggs0mvw4q9xhm0000gn/T/pip-record-12lkin0o/install-record.txt --single-version-externally-managed --compile --install-headers /Users/biellls/.virtualenvs/streamlit_test/include/site/python3.6/watchdog:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    creating build/lib.macosx-10.7-x86_64-3.6/watchdog
    copying src/watchdog/watchmedo.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog
    copying src/watchdog/version.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog
    copying src/watchdog/events.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog
    copying src/watchdog/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog
    creating build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/unicode_paths.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/compat.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/win32stat.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/dirsnapshot.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/delayed_queue.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/platform.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/importlib2.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/bricks.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/echo.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/event_backport.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    copying src/watchdog/utils/decorators.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/utils
    creating build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    copying src/watchdog/observers/fsevents.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    copying src/watchdog/observers/inotify.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    copying src/watchdog/observers/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    copying src/watchdog/observers/api.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    copying src/watchdog/observers/inotify_buffer.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    copying src/watchdog/observers/winapi.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    copying src/watchdog/observers/read_directory_changes.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    copying src/watchdog/observers/kqueue.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    copying src/watchdog/observers/inotify_c.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    copying src/watchdog/observers/polling.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    copying src/watchdog/observers/fsevents2.py -> build/lib.macosx-10.7-x86_64-3.6/watchdog/observers
    creating build/lib.macosx-10.7-x86_64-3.6/watchdog/tricks
    copying src/watchdog/tricks/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/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
    sh: line 1: 58148 Segmentation fault: 11  'gcc' --version 2> /dev/null > '/var/folders/6k/tmx4rbd56sjggs0mvw4q9xhm0000gn/T/tmp0yau2pnm'
    building '_watchdog_fsevents' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/src
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/biellls/anaconda3/include -arch x86_64 -I/Users/biellls/anaconda3/include -arch x86_64 -DWATCHDOG_VERSION_STRING="0.9.0" -DWATCHDOG_VERSION_MAJOR=0 -DWATCHDOG_VERSION_MINOR=9 -DWATCHDOG_VERSION_BUILD=0 -I/Users/biellls/.virtualenvs/streamlit_test/include -I/Users/biellls/anaconda3/include/python3.6m -c src/watchdog_fsevents.c -o build/temp.macosx-10.7-x86_64-3.6/src/watchdog_fsevents.o -std=c99 -pedantic -Wall -Wextra -fPIC -Wno-error=unused-command-line-argument-hard-error-in-future
    cc1: error: -Werror=unused-command-line-argument-hard-error-in-future: no option -Wunused-command-line-argument-hard-error-in-future
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/Users/biellls/.virtualenvs/streamlit_test/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/6k/tmx4rbd56sjggs0mvw4q9xhm0000gn/T/pip-install-g3xkfkuk/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 /private/var/folders/6k/tmx4rbd56sjggs0mvw4q9xhm0000gn/T/pip-record-12lkin0o/install-record.txt --single-version-externally-managed --compile --install-headers /Users/biellls/.virtualenvs/streamlit_test/include/site/python3.6/watchdog" failed with error code 1 in /private/var/folders/6k/tmx4rbd56sjggs0mvw4q9xhm0000gn/T/pip-install-g3xkfkuk/watchdog/

May be related to this https://github.com/sparklemotion/nokogiri/issues/1258

I am having the same issue. Have tried on two different laptops, one running 10.15 (Catalina), and the other running 10.14.6 (Mojave). Both get the same error when trying to build the watchdog wheel.?.

I am using a current Anaconda 3.x distribution, if that matters, and I have tried to do the install both inside of environments and not with no change.

I am really excited to give this a try and am happy to do whatever I can to help.

MarkH

I had the same issue. Try the below -

Export this on your terminal:
sudo ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" easy_install watchdog

Then pip install streamlit

Thanks, I finally solved it. The solution was in this issue: https://github.com/streamlit/streamlit/issues/283.

conda install -c conda-forge watchdog

Then:

pip install streamlit

If youโ€™re not using conda looks like @adi.kadrekarโ€™s solution would work.