关于python升级pymysql问题

小圆号 发布于 2018/07/14 15:09
阅读 843
收藏 0

用的是centos7,python是系统自带的python2.7.5,升级到python3.6.6.现在是用pip装的pymysql。显示成功安装。在python2.7下,显示import  pymysql成功,在python3.6.6下,出错。怎么调呢,那个大拿教教我。

输入python2.7运行

[root@localhost site-packages]# python2.7
Python 2.7.5 (default, Apr 11 2018, 07:36:10) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import  pymysql
>>> 

 

输入python,系统默认python3.6.6运行

[root@localhost site-packages]# python
Python 3.6.6 (default, Jun 29 2018, 17:36:49) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import  pymysql
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pymysql/__init__.py", line 28, in <module>
    from .converters import escape_dict, escape_sequence, escape_string
  File "/usr/lib/python2.7/site-packages/pymysql/converters.py", line 5, in <module>
    import re
  File "/usr/local/python3/lib/python3.6/re.py", line 142, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
>>>

咋处理???

加载中
返回顶部
顶部