mysql-python

How to fix the error coming pip install MySQL-python

How to fix the error coming pip install MySQL-python Question: C:Windowssystem32>pip install MySQL-python Collecting MySQL-python Using cached MySQL-python-1.2.5.zip (108 kB) Using legacy setup.py install for MySQL-python, since package ‘wheel’ is not installed. Installing collected packages: MySQL-python Running setup.py install for MySQL-python … error ERROR: Command errored out with exit status 1: command: ‘C:UsersPavan PAppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0python.exe’ -u …

Total answers: 3

Suggested way to run multiple sql statements in python?

Suggested way to run multiple sql statements in python? Question: What would be the suggested way to run something like the following in python: self.cursor.execute(‘SET FOREIGN_KEY_CHECKS=0; DROP TABLE IF EXISTS %s; SET FOREIGN_KEY_CHECKS=1’ % (table_name,)) For example, should this be three separate self.cursor.execute(…) statements? Is there a specific method that should be used other than …

Total answers: 9

Python MySQL Connector not inserting

Python MySQL Connector not inserting Question: So here is my code. I don’t know why insert isn’t working. A select statement works. It doesn’t fail the try catch either leading me to believe the query is executing. Also entering the insert query manually into MySQL Workbench seems to work fine. def runQuery(query): try: conn = …

Total answers: 1

"cryptography is required for sha256_password or caching_sha2_password"

"cryptography is required for sha256_password or caching_sha2_password" Question: Good day. Hope your all are well. Can someone help me with fix this? I’m new to the MySQL environment. I’m trying to connect to MySQL Database remotely. I used the following python code and got this error. Print(e) = “cryptography is required for sha256_password or caching_sha2_password” …

Total answers: 12

How to use MYSql from xampp for python 3?

How to use MYSql from xampp for python 3? Question: I am getting below error when I try to install MySQL client using the command “pip3 install mysqlclient”. Complete output from command python setup.py egg_info: /bin/sh: mysql_config: command not found Traceback (most recent call last): File “<string>”, line 1, in <module> File “/private/var/folders/l1/f1klm_s92g53c9v2p1vrdwg80000gn/T/pip-install-a0t6svmj/mysqlclient/setup.py”, line 18, …

Total answers: 3

Installing mysqlclient in Python 3.6 in windows

Installing mysqlclient in Python 3.6 in windows Question: I want to install MySqlclient on my windows system. I am Currently using Python 3.6. After going through the various post over Stackoverflow, I could Not find the correct way. This is what I have done so far: 1) Installation by using pip pip install mysqlclient. Error: …

Total answers: 10

django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured

django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured Question: I want to connect MySQL database to my django project, but it is throwing an error : “django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.” Trace: (myenv) LIBINGLADWINs-MacBook-Air:libinrenold$ django-admin dbshell …

Total answers: 9

AttributeError: module 'mysql' has no attribute 'connector'

AttributeError: module 'mysql' has no attribute 'connector' Question: I’m running Ubuntu 16.04, trying to connect to mysql in python: import mysql username = ‘root’ cnx = mysql.connector.connect(user=username, database=’db’) cnx.close() But I get an error: File “pysql1.py”, line 4, in <module> cnx = mysql.connector.connect(user=username, database=’db’) AttributeError: module ‘mysql’ has no attribute ‘connector’ I installed the mysql …

Total answers: 8

Error in foreign key constraint with SQLAlchemy

Error in foreign key constraint with SQLAlchemy Question: I am trying to implement very simple example table from an old course now in SQLAlchemy… I have got this far but when I run the code… from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Date, MetaData from sqlalchemy import ForeignKey from sqlalchemy.orm import relationship …

Total answers: 1

python setup.py egg_info mysqlclient

python setup.py egg_info mysqlclient Question: Trying to install mysqlclient using pip3 on Python 3.6.0 $ pip3 install mysqlclient Collecting mysqlclient Using cached mysqlclient-1.3.10.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File “<string>”, line 1, in <module> File “/private/var/folders/3k/08g3yx_12kg99kyfs989md600000gn/T/pip-build-1qv_89jc/mysqlclient/setup.py”, line 17, in <module> metadata, options = get_config() File “/private/var/folders/3k/08g3yx_12kg99kyfs989md600000gn/T/pip-build-1qv_89jc/mysqlclient/setup_posix.py”, line 54, …

Total answers: 10