Good day,
Can someone help me please, I recently installed an ssd and reinstalled windows and python.
Before I got a new ssd for my laptop the script ran fine on my HDD but now after installing the modules I get this error. What am I missing.
Can someone help me please, I recently installed an ssd and reinstalled windows and python.
Before I got a new ssd for my laptop the script ran fine on my HDD but now after installing the modules I get this error. What am I missing.
import JarvisAI import re import pprint import random import sys import subprocess import pyautogui import os import requests from win10toast import ToastNotifier from numba import jit toaster = ToastNotifier() url = "http://www.google.com" timeout = 5 try: request = requests.get(url, timeout=timeout) print("Connected to the Internet") toaster.show_toast("Jarvis Voice Assistant", "Systems Online", threaded=True, icon_path=None, duration=5) except (requests.ConnectionError, requests.Timeout) as exception: print("No internet connection.") toaster.show_toast("Jarvis Voice Assistant", "Systems Offline, Systems Shutting Down", threaded=True, icon_path=None, duration=5) sys.exit() obj = JarvisAI.JarvisAssistant() @jit(nopython=True) def t2s(text): obj.text2speech(text) t2s("Systems Online") while True: status, command = obj.hot_word_detect() if status: while True: res = obj.mic_input() print(res) if re.search('tell me jokes|joke|tell me a joke|tell me another joke', res): joke_ = obj.tell_me_joke('en', 'neutral') print(joke_) break if re.search('close window', res): t2s("closing window") pyautogui.hotkey('ctrl','w') break if re.search('you are stupid|stupid', res): print("no, im an not, you are") t2s("no, im am not, you are") # if re.search('do I need to put you on charge',res): # percent = str(battery.percent) # print("percent") # if percent <=20: # print("yes please") # t2s("yes please") # elif percent >20: # print("no not yet, check again later") # t2s("no not yet, check again later") if re.search('turn volume up',res): t2s("turning volume up") pyautogui.hotkey('volumeup') break if re.search('turn volume down',res): t2s("turning volume down") pyautogui.hotkey('volumedown') break if re.search('setup|set up', res): setup = obj.setup() print(setup) break if re.search('google photos', res): photos = obj.show_google_photos() print(photos) break if re.search('local photos', res): photos = obj.show_me_my_images() print(photos) break if re.search('take a screenshot', res): print("taking a screenshot") t2s("taking a screenshot") pyautogui.screenshot() break if re.search('restart', res): os.system('shutdown /r /t 1') print("restarting") t2s("Restarting will begin now") if re.search('shutdown|shut down',res): os.system('shutdown /s') print("shutting down") t2s("shutting down now, goodbye") if re.search('weather|temperature', res): city = res.split(' ')[-1] weather_res = obj.weather(city=city) print(weather_res) t2s(weather_res) break if re.search('news', res): news_res = obj.news() pprint.pprint(news_res) t2s(f"I have found {len(news_res)} news. You can read it. Let me tell you first 2 of them") t2s(news_res[0]) t2s(news_res[1]) break if re.search('tell me about', res): topic = res[14:] wiki_res = obj.tell_me(topic, sentences=1) print(wiki_res) t2s(wiki_res) break if re.search('what is the date', res): date = obj.tell_me_date() print(date) print(t2s(date)) break if re.search('what is the time', res): time = obj.tell_me_time() print(time) t2s(time) break if re.search('open', res): domain = res.split(' ')[-1] open_result = obj.website_opener(domain) print(open_result) break if re.search('launch', res): dict_app = {} app = res.split(' ', 1)[1] path = dict_app.get(app) if path is None: t2s('Application path not found') print('Application path not found') else: t2s('Launching: ' + app) obj.launch_any_app(path_of_app=path) break if re.search ("what is the percentage of my laptop", res): break if re.search('hello|hi', res): print('Hi') t2s('Hi') break if re.search('how are you', res): li = ['good', 'fine', 'great'] response = random.choice(li) print(f"I am {response}") t2s(f"I am {response}") break if re.search('your name|who are you', res): print("My name is Jarvis, I am your personal assistant") t2s("My name is Jarvis, I am your personal assistant") break if re.search('quit|bye|goodbye jarvis|goodbye', res): print("goodbye") t2s("goodbye") sys.exit() if re.search('who made you', res): print("DoominsinI Software") t2s("DoominsinI Software") if re.search('who is your boyfriend|do you have a boyfriend', res): print("my boyfriend is wifi") t2s("my boyfriend is wifi") if re.search('what can you do', res): li_commands = { "open websites": "Example: 'open youtube.com", "time": "Example: 'what time it is?'", "date": "Example: 'what date it is?'", "launch applications": "Example: 'launch chrome'", "tell me": "Example: 'tell me about India'", "weather": "Example: 'what weather/temperature in Mumbai?'", "news": "Example: 'news for today' ", } ans = """I can do lots of things, for example you can ask me time, date, weather in your city, I can open websites for you, launch application and more. See the list of commands-""" print(ans) pprint.pprint(li_commands) t2s(ans) break else: continue
Output:Connected to the Internet
Traceback (most recent call last):
File "E:\USB\DoominsinI Software\Jarvis-Assisant-master\Jarvis-Assisant-master\scripts\main.py", line 35, in <module>
t2s("Systems Online")
File "C:\Users\tyrel\AppData\Roaming\Python\Python36\site-packages\numba\core\dispatcher.py", line 420, in _compile_for_args
error_rewrite(e, 'typing')
File "C:\Users\tyrel\AppData\Roaming\Python\Python36\site-packages\numba\core\dispatcher.py", line 361, in error_rewrite
raise e.with_traceback(None)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
[1mUntyped global name 'obj':[0m [1m[1mCannot determine Numba type of <class 'JarvisAI.JarvisAssistant'>[0m
[1m
File "main.py", line 33:[0m
[1mdef t2s(text):
[1m obj.text2speech(text)
[0m [1m^[0m[0m
[0m
Larz60+ write Jun-19-2021, 11:20 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
You should paste the code from image into post with bbcode tags.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
You should paste the code from image into post with bbcode tags.