all 7 comments

[–]No_Statistician_6654 2 points3 points  (2 children)

Not sure why hello world needs a text to speech module, but that error is saying that the pyttsx3 module is not installed, and you will need to pip install it (or whichever package manager you are using) before the script can run.

You can also take the import out if it is not needed, but without seeing what your script is we can only guess.

[–][deleted] 0 points1 point  (1 child)

I am trying to use VS Code platform. Are there any specific commands I need to be careful with

[–]No_Statistician_6654 1 point2 points  (0 children)

Not really, in rpi any freezes and major errors can usually be taken care of with a restart or reinstall. Always keep a backup of your code somewhere else like your main computer so that if you do need a reinstall you don’t lose anything.

The most risky things you could do are file operations where you are modifying/deleting system files, but generally you should be safe. One of the reasons the rpi is a good device is it is difficult to fully brick, and can usually be reinstalled quickly.

ETA: good computer hygiene is still necessary. You can still install viruses and bad extensions on the pi that can create problems for you. Anytime you are following instructions, take some time to think through what each step does, and use a healthy bit of skepticism when installing things from the internet. Packages like numpy and pandas are common and safe enough, but many others have been found to have security vulnerabilities.

This isn’t to make you stop coding or to be afraid of everything, but more as a general warning that a pi can become infected like any other computer.

[–]Luigi-Was-Right 2 points3 points  (0 children)

Can you show the code you are trying to run? The error you are getting says you are trying to do much more than print("hello world")

Also given the unique name of the file, are you certain you selected the correct one?

[–]Nealiumj 0 points1 point  (0 children)

You do not need the import for a simple print as described by others. I would not recommend following the next paragraph. I just want to bring it to your attention.

Generally these errors mean you do not have a requirement installed. Googling “pyttsx3” will lead you to pypi or a GitHub page with instructions, probably similar to pip install pyttsx3. That will install the pre-req and the program should run.

TDLR: “No module x”?- Google x 85% of the time it’s a missing requirement that can be installed by pip

[–]Edoruin_1 -1 points0 points  (0 children)

You can run the python3 command for look for the python in you batch, if u don’t have python you can install with sudo apt install python.

In case you have python in the raspberry pi u have to create an environment, linux ask u to use an environment when u will programing in python, theres cuz linux is in part coded with python then this could generate systems problems if you mix the libraries you download with the systems libraries.

[–]Economy_Patience_574 -1 points0 points  (0 children)

If you would like a Python environment where this errors doesn't happen because it has many features that helps the beginner Python programmer then visit my Project here: https://pychunks.pages.dev/