Project Setup
During the development of the project, we'll come across various modules and external libraries. Let's learn and install them. But before we install them, let's create a virtual environment and activate it.
We are going to create a virtual environment using virtualenv. Python now ships with a pre-installed virtualenv library. So, to create a virtual environment, you can use the below command:
The above command will create a virtual environment named env. Now, we need to activate the environment using the command:
To verify if the environment has been activated or not, you can see (env) in your terminal. Now, we can install the libraries.
-
pyttsx3: pyttsx is a cross-platform text to speech library which is platform-independent. The major advantage of using this library for text-to-speech conversion is that it works offline. To install this module type the below command in the terminal.
- SpeechRecognition: It allows us to convert audio into text for further processing. To install this module type the below command in the terminal.
- pywhatkit: It is an easy-to-use library that will help us interact with the browser very easily. To install the module, run the following command in the terminal.
- wikipedia: It is used to fetch a variety of information from the Wikipedia website. To install this module type the below command in the terminal.
- requests: It is an elegant and simple HTTP library for Python that allows you to send HTTP/1.1 requests extremely easily. To install the module, run the following command in the terminal:
.env File
We need this file to store some private data such as API Keys, Passwords, etc related to the project. For now, let's store the name of the user and the bot.
Create a file named .env and add the following content there:
USER=Ashutosh
BOTNAME=JARVIS
To use the contents from .env file, we'll install another module called python-decouple as:
Learn more about Environment Variables in Python here.
7
