MySQL Forums
Forum List  »  Connector/Python

Re: beginner's fault? import mysql.connector errors
Posted by: Michael Gens
Date: February 02, 2017 12:49AM

Sure I can:

$ ./dbHandlingConnect.py
Traceback (most recent call last):
File "./dbHandlingConnect.py", line 13, in <module>
import mysql.connector
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mysql/connector/__init__.py", line 37, in <module>
from .connection import MySQLConnection
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mysql/connector/connection.py", line 39, in <module>
from .conversion import MySQLConverter
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mysql/connector/conversion.py", line 27, in <module>
import datetime
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/datetime.py", line 8, in <module>
import math as _math
File "/Users/MG/programming/python/basics/math.py", line 64
print "*",
^
SyntaxError: Missing parentheses in call to 'print'

I am wondering why math.py (another program I have written) is being listed. I do not call it in dbHandlingConnect.py and it is not written for Python 3. This explains the syntax error. But I still do not mention it in dbHandlingConnect.py.

o.k.

I found out that the name of my own program is sub-optimal so I changed it.


But after that I get the following (complete) trace back

$ ./dbHandlingConnect.py
Traceback (most recent call last):
File "./dbHandlingConnect.py", line 13, in <module>
import mysql.connector
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mysql/connector/__init__.py", line 37, in <module>
from .connection import MySQLConnection
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mysql/connector/connection.py", line 39, in <module>
from .conversion import MySQLConverter
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/mysql/connector/conversion.py", line 27, in <module>
import datetime
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/datetime.py", line 8, in <module>
import math as _math
ImportError: bad magic number in 'math': b'\x03\xf3\r\n'




Michael

Options: ReplyQuote


Subject
Written By
Posted
Re: beginner's fault? import mysql.connector errors
February 02, 2017 12:49AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.