How to Run the Mental Health Chatbot Using
Command Prompt - Easy Steps
Here's a complete guide using only Command Prompt to run the chatbot:
Step 1: Open Command Prompt
Multiple ways to open CMD: [1] [2]
Press Windows Key + R, type cmd, press Enter
Click Start Menu, type cmd, press Enter
Press Windows Key + X, choose "Command Prompt"
You'll see a black window like this:
C:\Users\YourName>
Step 2: Check if Python is Installed
Type this command and press Enter: [3] [4]
python --version
If you see something like "Python 3.13.1" → Great! Continue to Step 4
If you see "python is not recognized" → You need to install Python (go to Step 3)
Step 3: Install Python (if needed)
1. Go to python.org in your browser
2. Download Python (latest version)
3. IMPORTANT: Check "Add Python to PATH" during installation
4. After installation, close and reopen Command Prompt
5. Test again: python --version
Step 4: Download the Chatbot Project
First, check if Git is installed: [5]
git --version
If Git is not installed:
Go to git-scm.com and download Git
Install it with default settings
Download the project: [6]
git clone https://github.com/Vikranth3140/Mental-Health-Support-Chatbot.git
Go into the project folder:
cd Mental-Health-Support-Chatbot
Now you're inside the project! Your prompt should look like:
C:\Users\YourName\Mental-Health-Support-Chatbot>
Step 5: Create a Safe Environment
Create virtual environment: [3]
python -m venv env
Activate the environment:
env\Scripts\activate
You'll see (env) at the beginning of your prompt:
(env) C:\Users\YourName\Mental-Health-Support-Chatbot>
Step 6: Install Required Packages
Install all dependencies: [3]
pip install -r requirements.txt
Wait for it to download and install everything (Streamlit, OpenAI, etc.)
Step 7: Set Up OpenAI API Key
Get your API key first:
1. Go to platform.openai.com
2. Sign up/login
3. Go to API Keys section
4. Create new key and copy it
Add the key to your system: [7]
setx OPENAI_API_KEY "paste-your-key-here"
(Replace "paste-your-key-here" with your actual key)
Close and reopen Command Prompt, then:
1. Navigate back to project: cd Mental-Health-Support-Chatbot
2. Activate environment: env\Scripts\activate
Step 8: Run the Chatbot
Start the chatbot: [8] [9]
streamlit run app.py
You should see something like:
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://192.168.1.xxx:8501
Your browser will automatically open to the chatbot!
Step 9: Using the Chatbot
Type messages in the chat box
The bot will respond with mental health support
It tracks your mood automatically
Provides coping strategies
Step 10: Stop the Chatbot
To stop the chatbot: [10]
In Command Prompt, press Ctrl + C
You'll return to the normal prompt
To run again later:
1. Open Command Prompt
2. cd Mental-Health-Support-Chatbot
3. env\Scripts\activate
4. streamlit run app.py
Common Command Prompt Issues & Fixes
Problem: "streamlit is not recognized" [11] [12]
Make sure you activated the virtual environment: env\Scripts\activate
You should see (env) before your prompt
Problem: "python is not recognized" [13]
Reinstall Python and check "Add to PATH"
Or restart Command Prompt
Problem: Port already in use [8]
Close other instances of the chatbot
Or Streamlit will use a different port automatically
All Commands in Order (Summary)
Here's everything you need to type in Command Prompt: [6] [8] [3]
# Check Python
python --version
# Download project
git clone https://github.com/Vikranth3140/Mental-Health-Support-Chatbot.git
cd Mental-Health-Support-Chatbot
# Set up environment
python -m venv env
env\Scripts\activate
# Install packages
pip install -r requirements.txt
# Add API key (replace with your key)
setx OPENAI_API_KEY "your-actual-key-here"
# Close and reopen CMD, then navigate back and activate
cd Mental-Health-Support-Chatbot
env\Scripts\activate
# Run the chatbot
streamlit run app.py
That's it! The chatbot will open in your browser and you can start chatting!
The Command Prompt method gives you full control and works on any Windows computer. Just
follow these steps one by one, and you'll have your mental health support chatbot running
perfectly.
⁂
1. https://tutorial.djangogirls.org/en/intro_to_command_line/
2. https://www.ninjaone.com/blog/how-to-use-windows-command-prompt/
3. https://kinsta.com/blog/python-commands/
4. https://docs.python.org/3/using/cmdline.html
5. https://www.w3schools.com/git/git_install.asp?remote=github
6. https://github.com/Vikranth3140/Mental-Health-Support-Chatbot
7. https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
8. https://docs.streamlit.io/develop/api-reference/cli
9. https://docs.streamlit.io/develop/concepts/architecture/run-your-app
10. https://discuss.streamlit.io/t/how-to-get-back-to-command-prompt/36869
11. https://github.com/charann29/cmr_opensource/issues/356
12. https://discuss.streamlit.io/t/streamlit-on-windows/685
13. https://www.geeksforgeeks.org/how-to-install-python-on-windows/
14. https://realpython.com/run-python-scripts/
15. https://www.dell.com/support/kbdoc/en-in/000130703/the-command-prompt-what-it-is-and-how-to-u
se-it-on-a-dell-system
16. https://swcarpentry.github.io/python-novice-inflammation/12-cmdline.html
17. https://www.freecodecamp.org/news/command-line-commands-cli-tutorial/
18. https://stackoverflow.com/questions/54683892/make-python-project-into-command-line-tool
19. https://www.youtube.com/watch?v=QBWX_4ho8D4
20. https://docs.streamlit.io/get-started/installation/command-line
21. https://www.cs.princeton.edu/courses/archive/spr05/cos126/cmd-prompt.html
22. https://realpython.com/python-typer-cli/
23. https://www.geeksforgeeks.org/techtips/windows-command-prompt-tutorial/
24. https://www.youtube.com/watch?v=pFYcAOsNyvs