I am trying to make a bot that responds to certain question asked like ‘what is the time’ . I am trying to use pyttsx3 module to make it work but this error is coming:
Traceback (most recent call last):
File "/Users/HarAd MAC/Desktop/Projects/Python_Work/bot.py", line 1, in <module>
import pyttsx
ImportError: No module named pyttsx3
I have download the module and checked it in VS code Terminal. It is also showing Requirement already satisfied. Can someone help me in this problem. Same error was shown when I was trying to run it in pycharm. These type of problems have also occurred when using modules that have to be download manually.
I am using MacBook Air big Sur and python 3.9.
Thanks.
I don't know for sure but I believe when your import the library you have to do import pyttsx3 while what you were doing is import pyttsx. Here's some more info on usage and how to import
Related
I was following along a tutorial where they used the SpeechRecognition module, but when I made it to the first test it returns C:\Users\USER\PycharmProjects\Fatawi\venv\Scripts\python.exe C:/Users/USER/PycharmProjects/Fatawi/main.py Traceback (most recent call last): File "C:\Users\USER\PycharmProjects\Fatawi\main.py", line 1, in <module> import speech_recognition as sr ModuleNotFoundError: No module named 'speech_recognition'
I've tried reinstalling the library multiple times along with the PyAudio library. I ran the test that PyPi has for it and it works, but I don't know how fix it from here.
Check your python interpreter environment (the python version that's run the python file) maybe it's not the same version as python when you downloaded Speech Recognition.
Check if you activating the environemt.
For better understand see this blog in geeks for geeks might help you.
So aftergoing through some of the settings of the project file and checking the Python Interpreter it didn't have the SpeechRecognition Package. So I'm assuming that something went wrong with the install.
Thank you Faisal Faraj for the help.
I'm writing a program in VSCode, for the mindstorms ev3dev software.
I need to import pyautogui to simulate Keypresses, but VSCode returns this:
Starting: brickrun --directory="/home/robot/vscode-hello-python-master" "/home/robot/vscode-hello-python-master/hello.py"
----------
Traceback (most recent call last):
File "/home/robot/vscode-hello-python-master/hello.py", line 7, in <module>
import pyautogui
ImportError: No module named 'pyautogui'
----------
Exited with error code 1.
Now, i've tried using a venv, i've tried multiple solutions online, and multiple different modules like numpy or pynput but none seemed to work. (Mysteriously the library I use to communicate with the brick, ev3dev2, works...). VSCode is able to see the module, and give me suggestions to functions like keyUp or keyDown, but when running it, it doesn't work.
Btw, i run the code by 'debugging', idk what that means, i followed some instructions online. The debugging is needed to run the code on the mindstorms brick, I think.
VSCode recognising module
I was trying to use urllib library but an error was shown
import urllib.request
Traceback (most recent call last):
File "E:\coding\python for everybody\third part\urllib.py", line 1, in <module>
import urllib.request
File "E:\coding\python for everybody\third part\urllib.py", line 1, in <module>
import urllib.request
ModuleNotFoundError: No module named 'urllib.request'; 'urllib' is not a package
process is terminated with return code 1.
I installed urllib3 using pip but, the package was installed in roaming/python/python39/site-packages.
While the path is set to C:\Program Files\Python\scripts. The folders python39 and python are located in different folders. Also, upon checking I found that package urllib was installed already C:\Program Files\Python\scripts.
I don't know how python is accessing the packages and how it determines the location as none of the packages are being imported (except random and other preinstalled packages).This problem has been very problematic not only this time but many times before.
PS: some time ago I deleted python (6 months approx) and at that time python was installed in roaming is this the result of that?
I am also using anaconda distribution, but the above code was being written in sublime text(Windows 10).
UPDATE: ISSUE WAS SOLVED BY CHANGING THE FILE NAME(LOOK IN THE COMMENTS)
If you are using code editors like VSCode, Notepad+++ and not PyCharm or other python IDE. I think you should check your path and make sure that you have same python version.
Your filename is the same as the library that causes confusion, please change the name as python will get looking at the working directory for import hence the error
I'm following our tutorial. I already had python set up in VSC but I'm trying to use the Device Simulator express now. I'm getting an error when I hit play. It seems the system can't find the library error on line:
from adafruit_circuitplayground import cp
The error is:
Traceback (most recent call last):
File "c:/Users/YayaLenovoFlex/Documents/Python Scripts/trySimulator1.py", line 12, in
from adafruit_circuitplayground import cp
ModuleNotFoundError: No module named 'adafruit_circuitplayground'
Please help. I've very new to Visual Studio Code. I would rather use VSC then the MU editor if I can.
Thanks
Have you installed libraries by this command?
pip install adafruit_circuitplayground
I am currently trying to install a python module named "pyvjoy" (https://github.com/tidzo/pyvjoy) but I run into an error after importing
here's the error:
Traceback (most recent call last):
File "runner.py", line 5, in
import PlayHelper
File "C:\Users\Slay\Desktop\RLBot-master\PlayHelper.py", line 1, in
import pyvjoy
ModuleNotFoundError: No module named 'pyvjoy'
I have tried to install it via copying the library to C:\Python27\Lib\site-packages but no luck
1) You should be using a package manager instead of manually managing every package. Corollary: never use peoples code that isnt on pipy or conda, it means they havent gone through the effort to publish it and dont really expect anyone to use it.
2) You might like pygame or Tkinter for getting joystick input. Mature libraries that have been around for a while are almost always better then some dudes github project with 13 commits.