我在godaddy托管服务器上安装了Python 3.5.2,当我尝试“import sqlite3”时出现以下错误。为什么呢?
Python 3.5.2 (default, Nov 7 2016, 09:01:17)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/olgo/.local/lib/python3.5/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "/home/olgo/.local/lib/python3.5/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: No module named '_sqlite3'
>>>
更多信息,在尝试升级软件包时:
python3 -m pip install --upgrade sqlite3
Collecting sqlite3
Using cached sqlite3-99.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-mgkpf7dd/sqlite3/setup.py", line 2, in <module>
raise RuntimeError("Package 'sqlite3' must not be downloaded from pypi")
RuntimeError: Package 'sqlite3' must not be downloaded from pypi
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mgkpf7dd/sqlite3/