Python Forum
Debian 10 Buster Environment - Python 3.x (MariaDB 10.4.21) | Working Connector?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Debian 10 Buster Environment - Python 3.x (MariaDB 10.4.21) | Working Connector?
#7
Is this the correct output for a working MySQL connector within Python 3.9.9?

brandon@FireDragon:~/Python/sgml.bs4$ python w3.mysql.python.connector.py 
<mysql.connector.connection.MySQLConnection object at 0x7fb325cfcac0>
brandon@FireDragon:~/Python/sgml.bs4$
Updated to 3.9.9 from source per the following Blogs/Tutorials:



Source Blogs/Tutorials (Google Found):

https://tecadmin.net/how-to-install-pyth...-debian-9/
https://stackoverflow.com/questions/6274...amed-mysql

apt update

apt upgrade

apt install wget build-essential libreadline-gplv2-dev libncursesw5-dev \
     libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev


wget https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz


tar xzf Python-3.9.9.tgz

cd Python-3.9.9

./configure --enable-optimizations
error output :

fi
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
distutils: /usr/local/include/python3.9/UNKNOWN
sysconfig: /root/Python-3.9.9/Include/UNKNOWN
WARNING: Additional context:
user = False
home = None
root = '/'
prefix = None
Looking in links: /tmp/tmpi00_y1xa
Processing /tmp/tmpi00_y1xa/setuptools-58.1.0-py3-none-any.whl
Processing /tmp/tmpi00_y1xa/pip-21.2.4-py3-none-any.whl
Installing collected packages: setuptools, pip
  WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /usr/local/include/python3.9/setuptools
  sysconfig: /root/Python-3.9.9/Include/setuptools
  WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /usr/local/include/python3.9/pip
  sysconfig: /root/Python-3.9.9/Include/pip
Successfully installed pip-21.2.4 setuptools-58.1.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@FireDragon:~/Python-3.9.9#
root@FireDragon:~/Python-3.9.9# python3.9 -V
Python 3.9.9
root@FireDragon:~/Python-3.9.9#
pip3.9 -V
pip 21.2.4 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
nano -c /home/brandon/.bashrc

added the following 2 lines and saved:

alias python=python3.9
alias pip=pip3.9
brandon@FireDragon:~/Python/sgml.bs4$ python -V
Python 3.9.9
brandon@FireDragon:~/Python/sgml.bs4$ ./w3.mysql.python.connector.py
bash: ./w3.mysql.python.connector.py: Permission denied
brandon@FireDragon:~/Python/sgml.bs4$ python w3.mysql.python.connector.py 
Traceback (most recent call last):
  File "/home/brandon/Python/sgml.bs4/w3.mysql.python.connector.py", line 1, in <module>
    import mysql.connector
ModuleNotFoundError: No module named 'mysql'
brandon@FireDragon:~/Python/sgml.bs4$
brandon@FireDragon:~/Python/sgml.bs4$ pip install mariadb
Defaulting to user installation because normal site-packages is not writeable
Collecting mariadb
  Downloading mariadb-1.0.8.zip (85 kB)
     |████████████████████████████████| 85 kB 503 kB/s 
Using legacy 'setup.py install' for mariadb, since package 'wheel' is not installed.
Installing collected packages: mariadb
    Running setup.py install for mariadb ... done
Successfully installed mariadb-1.0.8
WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python3.9 -m pip install --upgrade pip' command.
brandon@FireDragon:~/Python/sgml.bs4$ pip install mysql
brandon@FireDragon:~/Python/sgml.bs4$ pip install mysql
Defaulting to user installation because normal site-packages is not writeable
Collecting mysql
  Downloading mysql-0.0.3-py3-none-any.whl (1.2 kB)
Collecting mysqlclient
  Downloading mysqlclient-2.1.0.tar.gz (87 kB)
     |████████████████████████████████| 87 kB 708 kB/s 
Using legacy 'setup.py install' for mysqlclient, since package 'wheel' is not installed.
Installing collected packages: mysqlclient, mysql
    Running setup.py install for mysqlclient ... done
Successfully installed mysql-0.0.3 mysqlclient-2.1.0
WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python3.9 -m pip install --upgrade pip' command.
brandon@FireDragon:~/Python/sgml.bs4$
brandon@FireDragon:~/Python/sgml.bs4$ python w3.mysql.python.connector.py 
Traceback (most recent call last):
  File "/home/brandon/Python/sgml.bs4/w3.mysql.python.connector.py", line 1, in <module>
    import mysql.connector
ModuleNotFoundError: No module named 'mysql'
brandon@FireDragon:~/Python/sgml.bs4$ pip install mysql-connector
Defaulting to user installation because normal site-packages is not writeable
Collecting mysql-connector
  Using cached mysql-connector-2.2.9.tar.gz (11.9 MB)
Using legacy 'setup.py install' for mysql-connector, since package 'wheel' is not installed.
Installing collected packages: mysql-connector
    Running setup.py install for mysql-connector ... done
Successfully installed mysql-connector-2.2.9
WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python3.9 -m pip install --upgrade pip' command.
brandon@FireDragon:~/Python/sgml.bs4$
“And one of the elders saith unto me, Weep not: behold, the Lion of the tribe of Juda, the Root of David, hath prevailed to open the book,...” - Revelation 5:5 (KJV)

“And oppress not the widow, nor the fatherless, the stranger, nor the poor; and ...” - Zechariah 7:10 (KJV)

#LetHISPeopleGo

Reply


Messages In This Thread
RE: Debian 10 Buster Environment - Python 3.x (MariaDB 10.4.21) | Working Connector? - by BrandonKastning - Nov-20-2021, 03:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Python Obstacles | Jeet-Kune-Do | BS4 (Tags > MariaDB) [URL/Local HTML] BrandonKastning 0 1,429 Feb-08-2022, 08:55 PM
Last Post: BrandonKastning
Question Securing State Constitutions (USA) from University of Maryland > MariaDB .sql BrandonKastning 1 1,541 Jan-21-2022, 06:34 PM
Last Post: BrandonKastning
Lightbulb Python Obstacles | Kung-Fu | Full File HTML Document Scrape and Store it in MariaDB BrandonKastning 5 2,928 Dec-29-2021, 02:26 AM
Last Post: BrandonKastning
  Python Obstacles | American Kenpo | Wiki Scrape URL/Table and Store it in MariaDB BrandonKastning 6 2,867 Dec-29-2021, 12:38 AM
Last Post: BrandonKastning
  Python Obstacles | Karate | HTML/Scrape Specific Tag and Store it in MariaDB BrandonKastning 8 3,183 Nov-22-2021, 01:38 AM
Last Post: BrandonKastning
  mod-python in apache2 on debian 9 xstation 6 3,847 Jun-15-2020, 01:29 PM
Last Post: DeaD_EyE
  Build a simple Webapp with Python Flask and mariaDB newbie1 3 3,408 Jun-04-2020, 09:34 PM
Last Post: lmolter54
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to write 3 Columns to MariaDB? BrandonKastning 21 7,029 Mar-23-2020, 05:51 PM
Last Post: ndc85430
  [Flask] Create new project for add user,edit,delete,view users in python with mysql connector chandranmanikandan 0 7,380 Oct-30-2018, 10:19 AM
Last Post: chandranmanikandan
  Eclipse Python We development Environment Adelton 3 4,595 Feb-16-2017, 08:52 PM
Last Post: Adelton

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020