An Unofficial Guide to Installing Rasa on an M1 Macbook

hi @itsjhonny !

I successfully installed Rasa on my M1 based on your guide, following up from this thread. Thank you! However, I am running into this when I run rasa train over on terminal:

I am not able to interact with the bot after running rasa shell in the terminal. What am I doing wrong?

Metal device set to: Apple M1

systemMemory: 8.00 GB
maxCacheSize: 2.67 GB

/opt/homebrew/Caskroom/miniforge/base/envs/rasadev/lib/python3.8/site-packages/rasa/utils/tensorflow/model_data.py:750: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
  np.concatenate(np.array(f)),
Epochs: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 100/100 [00:22<00:00,  4.47it/s, t_loss=1.27, i_acc=0.986]
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Finished training component.
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Starting to train component EntitySynonymMapper
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Finished training component.
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Starting to train component ResponseSelector
2022-07-21 11:40:13 INFO     rasa.nlu.selectors.response_selector  - Retrieval intent parameter was left to its default value. This response selector will be trained on training examples combining all retrieval intents.
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Finished training component.
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Starting to train component FallbackClassifier
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Finished training component.
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Successfully saved model into '/var/folders/rt/4dsv7dh93zbdjyj0hzvg12r00000gn/T/tmp525_f13q/nlu'
NLU model training completed.
Training Core model...
2022-07-21 11:40:20 WARNING  rasa.utils.common  - Failed to write global config. Error: [Errno 13] Permission denied: '/Users/karan/.config/rasa'. Skipping.
2022-07-21 11:40:20 WARNING  rasa.shared.utils.common  - The UnexpecTED Intent Policy is currently experimental and might change or be removed in the future πŸ”¬ Please share your feedback on it in the forum (http://forum.rasa.com) to help us make this feature ready for production.
Processed story blocks: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 3355.44it/s, # trackers=1]
Processed story blocks: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 1581.17it/s, # trackers=3]
Processed story blocks: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 381.44it/s, # trackers=12]
Processed story blocks: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 93.69it/s, # trackers=39]
Processed rules: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2/2 [00:00<00:00, 5679.49it/s, # trackers=1]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 3057.82it/s, # action=12]
Processed actions: 12it [00:00, 15582.55it/s, # examples=12]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2/2 [00:00<00:00, 5302.53it/s, # action=5]
Processed actions: 5it [00:00, 31823.25it/s, # examples=4]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 3192.01it/s, # action=12]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2/2 [00:00<00:00, 3502.55it/s]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:00<00:00, 2430.64it/s]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 120/120 [00:00<00:00, 5289.16it/s, # intent=12]
/opt/homebrew/Caskroom/miniforge/base/envs/rasadev/lib/python3.8/site-packages/rasa/utils/tensorflow/model_data_utils.py:383: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
  np.array(values), number_of_dimensions=4
Epochs:   0%|                                           | 0/100 [00:00<?, ?it/s]/opt/homebrew/Caskroom/miniforge/base/envs/rasadev/lib/python3.8/site-packages/tensorflow/python/framework/indexed_slices.py:448: UserWarning: Converting sparse IndexedSlices(IndexedSlices(indices=Tensor("gradients/cond_grad/Identity_1:0", shape=(None,), dtype=int64), values=Tensor("gradients/cond_grad/Identity:0", shape=(None,), dtype=float32), dense_shape=Tensor("gradients/cond_grad/Identity_2:0", shape=(1,), dtype=int32))) to a dense Tensor of unknown shape. This may consume a large amount of memory.
  warnings.warn(
/opt/homebrew/Caskroom/miniforge/base/envs/rasadev/lib/python3.8/site-packages/tensorflow/python/framework/indexed_slices.py:448: UserWarning: Converting sparse IndexedSlices(IndexedSlices(indices=Tensor("gradients/cond_1_grad/Identity_1:0", shape=(None,), dtype=int64), values=Tensor("gradients/cond_1_grad/Identity:0", shape=(None,), dtype=float32), dense_shape=Tensor("gradients/cond_1_grad/Identity_2:0", shape=(1,), dtype=int32))) to a dense Tensor of unknown shape. This may consume a large amount of memory.
  warnings.warn(
2022-07-21 11:40:28.403487: F tensorflow/core/framework/tensor.cc:681] Check failed: IsAligned() ptr = 0x2bea09910
zsh: abort      rasa train
(rasadev) karan@Nishakarans-MacBook-Air development % /opt/homebrew/Caskroom/miniforge/base/envs/rasadev/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d ''```

running rasa shell results in this

How can I install spacy models?

I could use the miniforge env above to install spacy 3.2.2, it seems there’s no issue. But the issue is now on actually training and running rasa for me :upside_down_face:

I think this is due to resource problem? Maybe you can try with a smaller training set.

Shouldn’t

conda activate rasa2-8

be called before calling the pip install ... commands?

Is there a way to install Rasa X? Or is that still a no for the M1 chip.

Created a repo with a step-by-step quickstart document here (for rasa 2.8.27)

1 Like
ERROR: Failed building wheel for xmlsec
ERROR: Could not build wheels for xmlsec, which is required to install pyproject.toml-based projects

failed
Traceback (most recent call last):
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda/exceptions.py", line 1129, in __call__
    return func(*args, **kwargs)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda_env/cli/main.py", line 80, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda/notices/core.py", line 72, in wrapper
    return_value = func(*args, **kwargs)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda_env/cli/main_create.py", line 156, in execute
    result[installer_type] = installer.install(prefix, pkg_specs, args, env)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda_env/installers/pip.py", line 70, in install
    return _pip_install_via_requirements(*args, **kwargs)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda_env/installers/pip.py", line 53, in _pip_install_via_requirements
    stdout, stderr = pip_subprocess(pip_cmd, prefix, cwd=pip_workdir)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda_env/pip_util.py", line 41, in pip_subprocess
    raise CondaEnvException("Pip failed")
conda.exceptions.CondaEnvException: Pip failed

This is the error im facing during conda enviroment creation

Hi @WTFFARIDZ, please take a look at Rasa Open Source 3.3 launched

1 Like

Thank you sharing it here.

Does anyone have ways to install Rasa Open Source 3.2X on M1 ?

I can install with pip3 install rasa. But as soon as I try to do rasa init, it gets stuck at the training step. I am on M1 Macbook Pro 14" with Ventura 13.0.1. Pls help, I need rasa for my thesis. I already tried the top post.

Rasa now supports M1 macbooks Hello Rasa Community!

I’m excited to announce that Rasa Open Source 3.3 has been released, and the docs have been updated. This launch includes a major improvement: Rasa supports native installations on Apple Silicon (M1/M2).

This also includes other updates like, continuous event export , caching message along with some bug fixes. You can find the full release notes here

Could not find a version that satisfies the requirement tensorflow<2.7.0,>=2.6.2 (from rasa) (from versions: none)

I am unable to install the rasa version 2.8.15 on my MacBook Air with M1 chip.

When I tried to install the rasa version 2.8.15 in macOS(Ventura 13.0) in PyCharm with a virtual environment having Python3.8 using the command

python3 -m pip install rasa==2.8.15

This is the error that it is raising related to tensorflow

ERROR: Could not find a version that satisfies the requirement tensorflow<2.7.0,>=2.6.2 (from rasa) (from versions: none)

ERROR: No matching distribution found for tensorflow<2.7.0,>=2.6.2

And while trying to install the tensorflow version 2.7.0 using the command

python3 -m pip install tensorflow==2.7.0

It is raising below error

ERROR: Could not find a version that satisfies the requirement tensorflow==2.7.0 (from versions: none)

ERROR: No matching distribution found for tensorflow==2.7.0

I googled the error and tried some of the things which were suggested to other people, but nothing worked for me.

Please suggest me a way, how can I install tensorflow version 2.7.0 on my MacBook Air M1.

So I can install rasa.

Thanks.

ERROR: Package 'rasa' requires a different Python: 3.9.6 not in '<3.9,>=3.7'

Got this error while installing it ``` pip install git+https://github.com/RasaHQ/rasa.git@3.0.4 --no-deps

I wasn’t able to use this approach but managed to install Rasa using python 3.9.12 and uninstalling and re-installing pip. Made a small guide here: Install Rasa in MacOS with M1 or M2 | by Gonzalo Mordecki | Feb, 2023 | Medium

Hi All, are there any updated env.yml as of June 2023 for Macbook M1 Chip? Badly need help for this one :frowning:

Me too. I am facing the issues to install rasa on my M1 pro! Please can anyone provide a working solution to it.

hello. I’m facing this error after conda env create -v --name rasatest -f env.yml command

raise CondaEnvException("Pip failed")
conda.exceptions.CondaEnvException: Pip failed

can anyone help me