<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Muhammad Mudassir</title>
    <description>The latest articles on DEV Community by Muhammad Mudassir (@muhammadmudassir).</description>
    <link>https://dev.to/muhammadmudassir</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1015026%2Fa1855a8c-a7ec-48b0-8d9d-355cd92bdc3b.PNG</url>
      <title>DEV Community: Muhammad Mudassir</title>
      <link>https://dev.to/muhammadmudassir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/muhammadmudassir"/>
    <language>en</language>
    <item>
      <title>How to Installing Rasa &amp; Building Rasa Chatbot on an M1 Macbook.</title>
      <dc:creator>Muhammad Mudassir</dc:creator>
      <pubDate>Thu, 26 Jan 2023 13:10:49 +0000</pubDate>
      <link>https://dev.to/muhammadmudassir/how-to-installing-rasa-building-rasa-chatbot-on-an-m1-macbook-444c</link>
      <guid>https://dev.to/muhammadmudassir/how-to-installing-rasa-building-rasa-chatbot-on-an-m1-macbook-444c</guid>
      <description>&lt;p&gt;First you setting up your environment setup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Python Environment Setup:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;you need to check your Python environment is already configured or not:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python3 --version&lt;br&gt;
pip3 --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If packages are already installed, these commands should display version numbers for each step, and you can skip to the next step.&lt;/p&gt;

&lt;p&gt;Otherwise, going to install &lt;a href="https://rasa.com/docs/rasa/installation/installing-rasa-open-source/" rel="noopener noreferrer"&gt;Here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In MacOS:&lt;/strong&gt;&lt;br&gt;
Now you can install Python3.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew update&lt;br&gt;
brew install python&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Virtual Environment Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the optional setup.but we strongly recommend isolating python projects using virtual environments. Tools like &lt;a href="https://virtualenv.pypa.io/en/latest/" rel="noopener noreferrer"&gt;virtualenv&lt;/a&gt; and &lt;a href="https://virtualenvwrapper.readthedocs.io/en/latest/" rel="noopener noreferrer"&gt;virtualenvwrapper&lt;/a&gt; provide isolated Python environments, which are cleaner than installing packages system-wide (as they prevent dependency conflicts). They also let you install packages without root privileges.&lt;/p&gt;

&lt;p&gt;Create a new virtual environment by choosing a Python interpreter and making a ./venv directory to hold it:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python3 -m venv ./venv&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Activate the virtual environment:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;source ./venv/bin/activate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to Deactivate the Virtual enviroment:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;deactivate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now your &lt;strong&gt;venv&lt;/strong&gt; enviroment setup is successfully ready.&lt;/p&gt;

&lt;p&gt;But when you install Rasa in this enviroment in M1 MacOS you have getting error. so now we can resolve this issue by following this. a step-by-step guide that explains how I got Rasa to work on a M1 Macbook. These steps seem to work on MacOS Montery v12.0.1. If you use an ealier version of the operating system you’ll likely need to upgrade.it is likely that things might change depending on the Tensorflow support for these devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Installing system dependencies:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, you’ll want to install some base dependencies for your operating system. We will use &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;brew&lt;/a&gt; 27 for this. If you don’t have brew installed you can do so by running:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The script explains what it will do and then pauses before it does it. Once brew is installed you can install the required system dependencies.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew install libpq libxml2 libxmlsec1 pkg-config postgresql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Conda enviroment setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;we need to install conda to handle all our dependencies.You can install conda by running it locally in your terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh&lt;br&gt;
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh&lt;br&gt;
source ~/miniforge3/bin/activate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will activate an environment that is maintained by conda. That means that conda is able to handle our Tensorflow dependencies from here on. Conda does not work with requirements.txt files that you may be familiar with from pip. Instead we will use a env.yml file. Here’s the one that will use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`channels:
  - apple
  - conda-forge

dependencies:
  - python==3.8.12
  - dask==2021.11.2
  - tensorflow-deps==2.6.0
  - numpy&amp;gt;=1.19.2,&amp;lt;1.20.0
  - scipy&amp;gt;=1.4.1,&amp;lt;1.8.0
  - scikit-learn&amp;gt;=0.22,&amp;lt;0.25
  - matplotlib==3.5.1
  - pip
  - pip:
      - absl-py==0.13.0
      - aio-pika==6.8.1
      - aiofiles==0.8.0
      - aioredis==2.0.1
      - aioresponses==0.7.2
      - aiormq==3.3.1
      - anyio==3.4.0
      - APScheduler==3.7.0
      - async-generator==1.10
      - async-timeout==4.0.2
      - aiohttp==3.8.1
      - httpcore==0.11.1
      - httplib2==0.20.2
      - httptools==0.3.0
      - httpx==0.15.4
      - bidict==0.21.4
      - blinker==1.4
      - boto3==1.20.28
      - botocore==1.23.28
      - CacheControl==0.12.10
      - cachy==0.3.0
      - certifi==2021.10.8
      - chardet==4.0.0
      - clang==5.0
      - cleo==0.8.1
      - clikit==0.6.2
      - colorama==0.4.4
      - colorclass==2.2.2
      - coloredlogs==15.0.1
      - colorhash==1.0.4
      - crashtest==0.3.1
      - croniter==1.1.0
      - cytoolz==0.11.2
      - decorator==5.1.0
      - defusedxml==0.7.1
      - distlib==0.3.4
      - dm-tree==0.1.6
      - docopt==0.6.2
      - fakeredis==1.7.0
      - fbmessenger==6.0.0
      - filelock==3.4.2
      - fire==0.4.0
      - flatbuffers==1.12
      - freezegun==1.1.0
      - future==0.18.2
      - gitdb==4.0.9
      - GitPython==3.1.3
      - google-auth==2.3.3
      - google-pasta==0.2.0
      - h11==0.9.0
      - HeapDict==1.0.1
      - html5lib==1.1
      - humanfriendly==10.0
      - isodate==0.6.1
      - jmespath==0.10.0
      - jsonpickle==2.0.0
      - jsonschema==3.2.0
      - kafka-python==2.0.2
      - keyring==21.8.0
      - locket==0.2.0
      - lockfile==0.12.2
      - lxml==4.7.1
      - mattermostwrapper==2.2
      - mock==4.0.3
      - multidict==5.0.0
      - munkres==1.1.4
      - mypy_extensions==0.4.3
      - networkx==2.6.3
      - oauth2client==4.1.3
      - onelogin==2.0.2
      - packaging==20.9
      - pamqp==2.3.0
      - pastel==0.2.1
      - pexpect==4.8.0
      - pika==1.2.0
      - pkgconfig==1.5.5
      - pkginfo==1.8.2
      - platformdirs==2.4.1
      - poetry==1.1.12
      - poetry-core==1.0.7
      - prompt-toolkit==2.0.10
      - protobuf==3.19.1
      - psycopg2-binary==2.9.3
      - ptyprocess==0.7.0
      - pyasn1==0.4.8
      - pyasn1-modules==0.2.7
      - pydot==1.4.2
      - pykwalify==1.8.0
      - pylev==1.4.0
      - pymongo==3.10.1
      - pyrsistent==0.18.0
      - pyTelegramBotAPI==3.8.3
      - python-crfsuite==0.9.7
      - python-engineio==4.3.0
      - python-socketio==5.5.0
      - python3-saml==1.12.0
      - questionary==1.10.0
      - randomname==0.1.5
      - redis==3.5.3
      - regex==2021.8.28
      - rfc3986==1.5.0
      - rocketchat-API==1.16.0
      - ruamel.yaml==0.16.13
      - ruamel.yaml.clib==0.2.2
      - s3transfer==0.5.0
      - sanic==21.6.0
      - sanic-jwt==1.7.0
      - sanic-plugin-toolkit==1.2.1
      - sanic-routing==0.7.0
      - sanic-cors==1.0.0
      - sentry-sdk==1.3.1
      - shellingham==1.4.0
      - simple-image-download==0.2
      - sklearn-crfsuite==0.3.6
      - slackclient==2.9.3
      - smmap==5.0.0
      - sniffio==1.2.0
      - SQLAlchemy==1.4.29
      - tabulate==0.8.9
      - tarsafe==0.0.3
      - tensorboard==2.7.0
      - tensorflow-estimator==2.6.0
      - tensorflow-hub==0.12.0
      - tensorflow-macos==2.6.0
      - tensorflow-metal==0.3.0
      - tensorflow-probability==0.13.0
      - termcolor==1.1.0
      - terminaltables==3.1.10
      - tfa-nightly==0.16.0.dev20220103155136
      - tomlkit==0.8.0
      - tqdm==4.62.3
      - twilio==6.50.1
      - typeguard==2.13.3
      - typing-utils==0.1.0
      - tzlocal==2.1
      - ujson==4.3.0
      - uvloop==0.14.0
      - virtualenv==20.13.0
      - wcwidth==0.2.5
      - webencodings==0.5.1
      - webexteamssdk==1.6
      - websockets==9.1
      - zict==2.0.0
      - requests-toolbelt==0.9.1
      - requests==2.26.0
      - requests-oauthlib==1.3.0
      - requests-toolbelt==0.9.1`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Given such an env.yml file, we can create a new environment. We’ll use the rasaM1 name for the environment.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;conda env create -v --name rasaM1 -f env.yml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once these dependencies are installed we can active our environment.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;conda activate rasaM1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Every time you want you can deactivate you conda enviroment.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Conda deactivate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.  Now we can install Rasa and it's dependencies.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;you’ll need to install the Rasa dependencies manually from git. The versions shown below have been tested beforehand and seem to work!&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install git+https://github.com/vpol/text.git --no-deps&lt;br&gt;
pip install git+https://github.com/RasaHQ/rasa-sdk@3.0.2 --no-deps&lt;br&gt;
pip install git+https://github.com/RasaHQ/rasa.git@3.0.4 --no-deps&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once that is finished you should be able to run Rasa!&lt;/p&gt;

&lt;p&gt;Now you can check which version of Rasa is installed.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python -m rasa --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;then you will init a project in directory.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rasa init --no-prompt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and start you rasa chatbot via.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rasa shell&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Congratulations! You have successfully installed Rasa Open Source!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
In this article you can learn how to install python and setup to venv enviroment. but we getting error to installing rasa on M1 Macbook So we can setup conda enviroment inspired by this &lt;a href="https://forum.rasa.com/t/an-unofficial-guide-to-installing-rasa-on-an-m1-macbook/51342" rel="noopener noreferrer"&gt;article&lt;/a&gt;. you can learn how to set conda enviroment and installing rasa and it's dependencies via github and you can also run you rasa chatbot by following this guide completely.&lt;/p&gt;

</description>
      <category>career</category>
      <category>productivity</category>
      <category>motivation</category>
    </item>
  </channel>
</rss>
