在virtualenv中下载sqlite3

问题描述:

我正在尝试使用命令 python3 manage.py startapp webapp 创建应用程序,但出现错误消息:

I'm trying to create app using the command python3 manage.py startapp webapp but i'm getting an error that says:

django.core.exceptions.ImproperlyConfigured:错误加载pysqlite2或sqlite3模块(按此顺序尝试):未命名模块'_sqlite3'

django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named '_sqlite3'

所以我尝试使用 pip install sqlite3 安装sqlite3,但出现此错误:

So I tried installing sqlite3 using pip install sqlite3 but I got this error:

使用缓存的sqlite3-99.0.tar.gz

Using cached sqlite3-99.0.tar.gz

从命令python setup.py egg_info完成输出:

Complete output from command python setup.py egg_info:

回溯(最近通话最近一次):

Traceback (most recent call last):

文件",位于

文件"/tmp/pip-build-dbz_f1ia/sqlite3/setup.py",第2行,在引发RuntimeError(不得从pypi下载软件包'sqlite3'")

File "/tmp/pip-build-dbz_f1ia/sqlite3/setup.py", line 2, in raise RuntimeError("Package 'sqlite3' must not be downloaded from pypi")

RuntimeError:不得从pypi下载软件包"sqlite3"

RuntimeError: Package 'sqlite3' must not be downloaded from pypi

/tmp/pip-build-dbz_f1ia/sqlite3/

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dbz_f1ia/sqlite3/

我尝试运行以下命令: sudo apt install sqlite3 ,但它说sudo不是有效命令,即使apt也不是出于某种原因.我正在运行Python3.6.2.我在Godaddy主机上安装了Python,并且正在使用SSH来安装所有内容.我安装了Python并设置了virtualenv.之后,我安装了Django并创建了一个Django项目.如何解决这些错误以成功创建Django应用?

I tried running this command: sudo apt install sqlite3 but it says sudo is not a valid command, even apt isn't for some reason. I'm running Python3.6.2. I installed Python on my Godaddy hosting and i'm using SSH to install everything. I installed Python and setup a virtualenv. Afterwards, I installed Django and created a Django project. How can I fix these errors to successfully create a Django app?

sqlite3 是标准库的一部分.您不必安装它.

sqlite3 is part of the standard library. You don't have to install it.

如果给您一个错误,则可能需要安装发行版的python-dev软件包,例如,使用 sudo apt-get install python-dev .

If it's giving you an error, you probably need to install your distribution's python-dev packages, eg with sudo apt-get install python-dev.