python3为什么import pymysql 报错:AttributeError: module 'six' has no attribute 'add_

就爱cream饼干 发布于 2018/08/07 17:58
阅读 790
收藏 0
#!/usr/bin/python3
import pymysql.cursors

db = pymysql.connect(
    host = '127.0.0.1',
    port = 3306,
    user = 'root',
    passwd = 'root',
    db = 'li',
    charset = 'utf-8'
)

conn = db.cursor()
sql = """create table page(
          id bigint(7) not null ,
          title varchar(200),
          content vachar(10000),
          created timestamp default current_timestamp ,
          primary key (id)
)
"""
conn.execute(sql)
conn.close()
db.close()

错误提示:

E:\untitled\venv\Scripts\python3.exe E:/untitled/two/mysql_one.py
Traceback (most recent call last):
  File "E:/untitled/two/mysql_one.py", line 2, in <module>
    import pymysql.cursors
  File "E:\untitled\venv\lib\site-packages\pymysql\__init__.py", line 96, in <module>
    from . import connections as _orig_conn
  File "E:\untitled\venv\lib\site-packages\pymysql\connections.py", line 17, in <module>
    from . import _auth
  File "E:\untitled\venv\lib\site-packages\pymysql\_auth.py", line 9, in <module>
    from cryptography.hazmat.primitives import serialization, hashes
  File "E:\untitled\venv\lib\site-packages\cryptography\hazmat\primitives\serialization.py", line 16, in <module>
    from cryptography.hazmat.primitives.asymmetric import dsa, ec, rsa
  File "E:\untitled\venv\lib\site-packages\cryptography\hazmat\primitives\asymmetric\__init__.py", line 12, in <module>
    @six.add_metaclass(abc.ABCMeta)
AttributeError: module 'six' has no attribute 'add_metaclass'

Process finished with exit code 1
 

加载中
0
007
007

pip install six

就爱cream饼干
就爱cream饼干
不行诶
0
sami
sami

pip3 install six

就爱cream饼干
就爱cream饼干
不行诶,pip后说已经satisfied
0
wei2011
wei2011

pip install six -U

就爱cream饼干
就爱cream饼干
不行呢,pip不成功
返回顶部
顶部