8

If you look in /usr/bin, there are actually only two versions installed: $ ls -la /usr/bin/python* lrwxrwxrwx 1 root root 9 Jun 5 23:08 /usr/bin/python -> python2.7 -rwxr-xr-x 1 root root 2679344 May 6 19:31 /usr/bin/python2.7 lrwxrwxrwx 1 root root 9 Aug 2 18:04 /usr/bin/python3 -> python3.2 lrwxrwxrwx 1 root root 11 Jul 6 09:52 /...


7

The command is: cat /proc/cpuinfo And the list over the different hardware is here: http://elinux.org/RPi_HardwareHistory#Board_Revision_History Table over hardware differences: https://www.element14.com/community/community/raspberry-pi/blog/2016/11/21/how-to-identify-which-model-of-the-raspberry-pi-you-have


7

For asynch : import os myfolder="/home/pi/Desktop" def onMyButtonClick(): os.system("pcmanfm \"%s\"" % myfolder) For asynch or ̶s̶y̶n̶c̶h̶ use python subprocess Popen : import subprocess myfolder="/home/pi/Desktop" def onMyButtonClick(): p = subprocess.Popen(["pcmanfm", "%s" % myfolder], stdin=subprocess.PIPE, stdout=subprocess.PIPE) ...


6

You have to install the MySQLdb package: sudo apt-get update then sudo apt-get install python3-dev libmysqlclient-dev This took a while and finally: sudo pip3 install mysqlclient now it should work the following command: pi@raspberrypi:~ $ python3.5 Python 3.5.2 (default, Dec 15 2017, 15:32:37) [GCC 4.9.2] on linux Type "help", "copyright", "credits" ...


6

There is NO NEED to do anything before a reboot. If you issue a sudo reboot command Linux will manage an orderly shutdown of the software. This is, however, a poor way of ensuring a reliable 24/7 system. If it crashes there is no guarantee the reboot itself would happen. The normal solution would be to use a watchdog timer. The Pi has an inbuilt hardware ...


6

There are some benchmarks from Henner Zeller's repository on GitHub which claimed that directly outputting data to the GPIO could achieve up to 65.8 MHz on a Raspberry Pi 3 (not B+, mind, but I suspect the figures won't be that far off). The code used is available here in C and the author gives the following pseudocode equivalent: // Pseudocode for (;;) { ...


6

Thats because by using 'GPIO.setmode(GPIO.BCM)' you are specifying the BCM numbering convention. GPIO 18 is actual pin number 12.


6

As is typical with crontab issues. The environment is not the same as your user or even a sudo/root shell , and env python3 may not return anything (env simply searches through Instead you should explicitly use the full path of python which can be found either as which python3 or which $(env python3) and use that full path in your crontab (typically /usr/...


5

This error was resolved when I disconnected and reconnected my camera module. Somehow my camera module must have been wiggled loose when I was working with it and the Pi was not able to detect the camera. I ran the command: vcgencmd get_camera and got Returned supported=1 detected=0 Once the camera was reconnected, I was able to run raspistill -o image....


5

Neither thread is actually started. Instead of threading.Thread(target = thread1()) you should use threading.Thread(target = thread1) At the moment you are calling a function which never returns so subsequent lines of the script are not executed.


5

Your tag says python3. If you are running your code in python3 you need to install speechrecognition with pip3.


5

Your script is a typical use of a service. Usually a service is started once and then it is running in background until it is stopped by the service manager. The service manager can restart a script but it isn't made to be used for loops because it is working on system level with logging and dependency checking and all to manage services. So first you ...


5

Okay, I have solved my problem. I reinstalled Python 3.6. Then I used this command sudo apt-get install libhdf5-dev and then sudo pip install tensorflow and installed TensorFlow successfully! I think the problem was with my Python installation. Thanks to all of you for your kindness. Cheers!!!


4

According to docs.python.org os.popen() is stacked on top of subprocess.Popen() - at least for Python 3.x: This is implemented using subprocess.Popen; see that class’s documentation for more powerful ways to manage and communicate with subprocesses. So other than losing some of the more finegrained controls the underlying subprocess.Popen() provides ...


4

It's worth noting that rc.local is run by root, rather than the pi user which you are likely using at your terminal. It seems likely that your installation for the telepot module is installed only for the pi user, and hence when root runs the script, the module cannot be found. If this is the case, you have two options: Install the telepot module globally ...


4

From the error log, it seems to be an issue with the SSL protocol being used: File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1149, in _raise_ssl_error raise WantReadError() OpenSSL.SSL.WantReadError This seems to be related to the recent blackout in supporting TLS 1.0 and 1.1 for pip. See this answer for details. In summary, upgrade pip as ...


4

It says "Cannot open shared object". ImportError:libQTtest.so.4:cannot open shared object file:no such file or directory Yes, but it does not say this is because "the library isnt shared with it". What it says is, "no such file or directory". As far as I can tell, libQTtest.so.4 is not actually part of openCV, although it is part of a GUI framework ...


4

python is never Python 3 in Debian, even if you have installed Python 3. Python 3 will install as python3, and the python binary points to Python 2 (see PEP 394) instead. In Python 2, the socketserver module used to be called SocketServer (note the caps). Changing all references from socketserver to SocketServer would address that. You can solve this by ...


4

Building scipy from source takes about 1hr20. Pre-compiled wheels are available from piwheels.org, so you can install it from there without building yourself. Raspbian Stretch is pre-configured to use piwheels. Are you on an older Raspbian version or another distribution? See piwheels.org for info on how to configure your system to use it or try: sudo pip3 ...


4

From Sparkfun website: The three methods covered in this tutorial are: rc.local - Likely the easiest and simplest way to get your program to run on boot. The downside is that tasks started with rc.local happen before the X windows system starts, which means you will not have access to graphical user interface (GUI) elements. autostart - Used to ...


4

You can launch a terminal via a command; this should include an option to execute a command inside the terminal as well. There are various GUI terminal applications available on GNU/Linux. They are usually paired with the DE (desktop environment). The default DE on Raspbian ("the DE formerly known as PIXEL", for lack of a better name1) is derived from ...


4

You can run the script as service using systemd. Just create a Unit file with: rpi ~$ sudo systemctl --force --full edit myscript.service In the empty editor insert these statements, save them and quit the editor: [Unit] Description=My Python Script After=multi-user.target [Service] RestartSec=10 Restart=always ExecStart=/full/path/to/myscript.py [...


4

12V pump will require 12V PSU. 20LPM is a pretty reasonable flow rate for a small pump so your pump PSU will need to have enough power to drive the pump - check the max current draw on startup (which will be higher than the running power draw) and size the PSU accordingly. Check the contact handling voltage/current for your relays. "5V" relays (as ...


4

For a rough measurement, I generated a 2000 x 2000 matrix with random integer entries between 0 and 9, and timed computation of the determinant in SageMath (I did this twice, with similar results). On my Raspberry Pi 4B, the computation took 15 minutes, compared to just over 3 minutes on my 10-year-old desktop with a quad-core i7-860 processor. The least ...


3

Arguments given to Python's subprocess and friends are generally not allowed to have spaces. omx = run(["omxplayer", '--win', '1,1,500,400', videoPath]) The above should work. In this instance, single or double quotes don't matter. Make sure to have '--win' and the geometry specification next to each other in the correct order.


3

You have not told us which system you use so it is speculation as to whether you will have problems or not. I believe Debian based systems use Python 2 for system purposes.


3

The code you use has the standard errors for this algorithm. It assumes everything always works perfectly without error. As a programming exercise you need to think about under what conditions the while loops would not terminate. You then need to protect against those conditions. The code you linked has added protection in one loop but not the other. It ...


3

Python 3 is a backward incompatible upgrade of the language. As already mentioned, so much was changed, that most programs won't work on Python 3 without modifications. Even worse, many Python libraries are not compatible with Python 3 yet. This is why at least two versions are needed - legacy Python 2.x and new Python 3.x. This is exactly what you have on ...


3

WIFI Configuration Before Complete Boot-up Of Pi You cannot usefully do anything network related before the Pi boots up properly. I think you have just misconstrued the concept of "booting", and what you really mean is you want the Pi to boot up the first time in a state where the goal is to get a wifi configuration somehow. Kind of like when you buy an ...


3

No, it is not necessary to stop the Pi camera before rebooting.


Only top voted, non community-wiki answers of a minimum length are eligible