Bazel error when installing Rasa on MacOS

I’m trying to install Rasa on MacOS 10.13.6 High Sierra. I’m running Python 3.7.10 and pip 21.1.2.

I followed the steps on Installation and when I ran pip3 install rasa I got the following error:

 Building wheel for dm-tree (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/rodmaia/Trb/Repos/rasa-for-beginners/venv/bin/python3.7 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n1/bfj4sbvx0nqfcdc2h3_sbm800000gn/T/pip-install-0j_v14r9/dm-tree_3f503f1e11d1463190c53f9533ccb27b/setup.py'"'"'; __file__='"'"'/private/var/folders/n1/bfj4sbvx0nqfcdc2h3_sbm800000gn/T/pip-install-0j_v14r9/dm-tree_3f503f1e11d1463190c53f9533ccb27b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/n1/bfj4sbvx0nqfcdc2h3_sbm800000gn/T/pip-wheel-t93bvd7t
       cwd: /private/var/folders/n1/bfj4sbvx0nqfcdc2h3_sbm800000gn/T/pip-install-0j_v14r9/dm-tree_3f503f1e11d1463190c53f9533ccb27b/
  Complete output (13 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.13-x86_64-3.7
  creating build/lib.macosx-10.13-x86_64-3.7/tree
  copying tree/__init__.py -> build/lib.macosx-10.13-x86_64-3.7/tree
  copying tree/tree_benchmark.py -> build/lib.macosx-10.13-x86_64-3.7/tree
  copying tree/tree_test.py -> build/lib.macosx-10.13-x86_64-3.7/tree
  running build_ext
  bazel build //tree:_tree --symlink_prefix=build/temp.macosx-10.13-x86_64-3.7/bazel- --compilation_mode=opt
  unable to execute 'bazel': No such file or directory
  error: command 'bazel' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for dm-tree
  Running setup.py clean for dm-tree
Failed to build dm-tree
Installing collected packages: dm-tree, decorator, cycler, cryptography, coloredlogs, cloudpickle, bidict, aiormq, aiohttp, webexteamssdk, twilio, terminaltables, tensorflow-text, tensorflow-probability, tensorflow-hub, tensorflow-addons, SQLAlchemy, slackclient, sklearn-crfsuite, sentry-sdk, scikit-learn, sanic-jwt, rocketchat-API, regex, redis, rasa-sdk, questionary, python-socketio, pyTelegramBotAPI, pykwalify, pydot, psycopg2-binary, packaging, oauth2client, networkx, mattermostwrapper, matplotlib, kafka-python, jsonschema, jsonpickle, fbmessenger, colorhash, colorclass, boto3, async-generator, apscheduler, aio-pika, rasa
    Running setup.py install for dm-tree ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/rodmaia/Trb/Repos/rasa-for-beginners/venv/bin/python3.7 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n1/bfj4sbvx0nqfcdc2h3_sbm800000gn/T/pip-install-0j_v14r9/dm-tree_3f503f1e11d1463190c53f9533ccb27b/setup.py'"'"'; __file__='"'"'/private/var/folders/n1/bfj4sbvx0nqfcdc2h3_sbm800000gn/T/pip-install-0j_v14r9/dm-tree_3f503f1e11d1463190c53f9533ccb27b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/n1/bfj4sbvx0nqfcdc2h3_sbm800000gn/T/pip-record-97hes039/install-record.txt --single-version-externally-managed --compile --install-headers /Users/rodmaia/Trb/Repos/rasa-for-beginners/venv/include/site/python3.7/dm-tree
         cwd: /private/var/folders/n1/bfj4sbvx0nqfcdc2h3_sbm800000gn/T/pip-install-0j_v14r9/dm-tree_3f503f1e11d1463190c53f9533ccb27b/
    Complete output (13 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.13-x86_64-3.7
    creating build/lib.macosx-10.13-x86_64-3.7/tree
    copying tree/__init__.py -> build/lib.macosx-10.13-x86_64-3.7/tree
    copying tree/tree_benchmark.py -> build/lib.macosx-10.13-x86_64-3.7/tree
    copying tree/tree_test.py -> build/lib.macosx-10.13-x86_64-3.7/tree
    running build_ext
    bazel build //tree:_tree --symlink_prefix=build/temp.macosx-10.13-x86_64-3.7/bazel- --compilation_mode=opt
    unable to execute 'bazel': No such file or directory
    error: command 'bazel' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/rodmaia/Trb/Repos/rasa-for-beginners/venv/bin/python3.7 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/n1/bfj4sbvx0nqfcdc2h3_sbm800000gn/T/pip-install-0j_v14r9/dm-tree_3f503f1e11d1463190c53f9533ccb27b/setup.py'"'"'; __file__='"'"'/private/var/folders/n1/bfj4sbvx0nqfcdc2h3_sbm800000gn/T/pip-install-0j_v14r9/dm-tree_3f503f1e11d1463190c53f9533ccb27b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/n1/bfj4sbvx0nqfcdc2h3_sbm800000gn/T/pip-record-97hes039/install-record.txt --single-version-externally-managed --compile --install-headers /Users/rodmaia/Trb/Repos/rasa-for-beginners/venv/include/site/python3.7/dm-tree Check the logs for full command output.

Same thing happened with Python 3.6.x and 3.8.x. I also tried Python 3.9.x but that gave me a “rasa command not found”.

What config changes do I need to make?

1 Like

Hi @rodmaia I have the same problem. Do you have resolved it? Look the image

Hey @sahlre! No I haven’t had any luck with it yet… :frowning:

@rodmaia check for software update in your Mac please. Follow these video:

For Mac: https://youtu.be/fqzsE70Rvr0

For Window: https://youtu.be/4ewIABo0OkU

Hi @nik202, I followed the instructions on the video but got the same error as above. BTW the tutorial is for MacOS Catalina but unfortunately I can’t update my mac beyond High Sierra.

@rodmaia I will encourage create the virtual environment of high Sierra or window and try to install. At least check the image of macOS Mojave 10.14.6. If it is install on virtual machine then its the version issue of your Mac or python even 3.8 etc.

Or try installing bazel may be it will solve your error. [Installing Bazel on macOS - Bazel main]

Or Have you tried doing pip install dm-tree within your conda environment?

@nik202 I tried installing Bazel separately and also tried pip install dm-tree and both failed. Seems like they are truly incompatible with High Sierra.

I’m a newbie and I’m using High Sierra on my work computer. I’ll see if I can install Mojave in a virtual environment like you suggested.

Thanks for the help!

@rodmaia you need to update to latest version mate then only it will work fine, believe me on this. Please see this link : Problem to install Rasa Open Source - Running setup.py install for dm-tree ... error - #9 by sahlre

I already suggested this to you, that’s why I share you the linked thread so that It will help you.

Do let me know if error persisted?

@nik202 I do believe you. There are other considerations outside Rasa regarding an upgrade to Mojave or BigSur.

I’ll let you know if solve this. Thanks again.