ImportError: No module named _sqlite3
Posted karihou
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ImportError: No module named _sqlite3相关的知识,希望对你有一定的参考价值。
报错如下:
>>> import rpy2.robjects Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/python27/lib/python2.7/site-packages/rpy2-2.8.5-py2.7-linux-x86_64.egg/rpy2/robjects/__init__.py", line 34, in <module> from rpy2.robjects.functions import Function, SignatureTranslatedFunction File "/usr/local/python27/lib/python2.7/site-packages/rpy2-2.8.5-py2.7-linux-x86_64.egg/rpy2/robjects/functions.py", line 5, in <module> from rpy2.robjects import help File "/usr/local/python27/lib/python2.7/site-packages/rpy2-2.8.5-py2.7-linux-x86_64.egg/rpy2/robjects/help.py", line 7, in <module> import sqlite3 File "/usr/local/python27/lib/python2.7/sqlite3/__init__.py", line 24, in <module> from dbapi2 import * File "/usr/local/python27/lib/python2.7/sqlite3/dbapi2.py", line 28, in <module> from _sqlite3 import * ImportError: No module named _sqlite3
问题原因:
在系统中同时存在多个不同版本的python。当前系统是由python 2.6.6升级到python 2.7.13而来。
解决办法:
[[email protected] sqlite-autoconf-3150000]# find / -name _sqlite3.so /usr/lib64/python2.6/lib-dynload/_sqlite3.so [[email protected] sqlite-autoconf-3150000]# whereis python python: /usr/bin/python /usr/bin/python2.6 /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/share/man/man1/python.1.gz [[email protected] sqlite-autoconf-3150000]# find / -name lib-dynload /usr/lib64/python2.6/lib-dynload /usr/local/python27/lib/python2.7/lib-dynload [[email protected] sqlite-autoconf-3150000]# cp /usr/lib64/python2.6/lib-dynload/_sqlite3.so /usr/local/python27/lib/python2.7/lib-dynload [[email protected] sqlite-autoconf-3150000]# python Python 2.7.13 (default, Mar 9 2017, 04:32:58) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 >>> import rpy2.robjects >>> >>>
以上是关于ImportError: No module named _sqlite3的主要内容,如果未能解决你的问题,请参考以下文章
ImportError : No module named graphics
python27 ImportError: No module named site
Python中ImportError: No module named request
ImportError: No module named win32api