thevickypedia/Jarvis

Python request module errors

salimdason opened this issue · 3 comments

Running the command python3 jarvis.py on my windows 10 computer throws back the following error:

Traceback (most recent call last):
File "C:\Users\dason\Desktop\Jarvis\Jarvis-master\jarvis.py", line 18, in
import certifi and the other modules. i.e

import holidays
import pytemperature
import pyttsx3 as audio
import requests
import speech_recognition as sr
import yaml

I have installed all the necessary requirements.

Any idea on how I can get around this error will be appreciated.

@salimdason - I'd suspect env variables to be the culprit, make sure you add the location (where you installed your modules) to the PATH env variable.

However I'd suggest using an IDE (like PyCharm), if you are already using an IDE setup a venv and make your life easy.
I'd start with installing PyCharm's community edition, setup a virtual environment and then run the bash install_windows.sh so the requirements gets installed into venv and then the python3 jarvis.py should work fine.

I'm running on a mac but it should be the same for Windows. Comment back if it doesn't, I will take a look.

Screen Shot 2020-12-27 at 12 03 08 PM

@salimdason I just realized your issue when I ran into the same. The issue is not with the modules, it is with your env where you install. To do a clean slate install follow the below commands:

python3 -m venv jarvis_venv  # this will create a virtual env named jarvis_venv

source jarvis_venv/bin/activate  # activate your virtual env

which python  # check if python is now pointing to your virtual env

bash installs_windows.sh  # now start installing your requirements

In the sample below my initial run failed the same way as yours when I did not activate the venv so python uses the default env where none of the dependencies were installed. FYI - My virtual env name is venv

Sample:
sample