On 2020-05-07 12:30, rackf...@gmail.com wrote:
I have the same issue. I use visual code from Ms and the remote debugging over
an ssh.
I am able to do all mysql while in the debugger but running on command line
does not work.
The DB is logged in as root as this was the only way I could make it work.
pi@raspberrypi:~/blescan/iBeacon-Scanner-$ pip search mysql-connector | grep
--color mysql-connector-python
mysql-connector-python (8.0.20) - MySQL driver written in Python
mysql-connector-python-dd (2.0.2) - MySQL driver written in Python
mysql-connector-python-rf (2.2.2) - MySQL driver written in Python
pi@raspberrypi:~/blescan/iBeacon-Scanner-$ pip install mysql-connector-python-rf
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: mysql-connector-python-rf in
/home/pi/.local/lib/python3.7/site-packages (2.2.2)
pi@raspberrypi:~/blescan/iBeacon-Scanner-$ sudo python3 BeaconClass.py
Traceback (most recent call last): File
"BeaconClass.py", line 7, in <module>
import mysql.connector as mariadb
ModuleNotFoundError: No module named 'mysql'
pi@raspberrypi:~/blescan/iBeacon-Scanner-$
I believe that it's "pip" for "python" (Python 2) and "pip3" for
"python3" (Python 3).
Personally, I'd use:
python3 -m pip ...
or:
sudo python3 -m pip ...
instead.
--
https://mail.python.org/mailman/listinfo/python-list