“运行Django的”python3 manage.py migrate“时没有名为'_sqlite3'的模块”

时间:2022-05-28 10:54:58

I'm using Ubuntu 16.04 and I'm trying to learn Django and I installed it in my virtual environment and named it myenv, and I started a project named mysite. When I tried to run the manage.py file, it kept saying sqlite3 is not installed. I did install it, but it is saying the same error. When I run python3 manage.py migrate, it says:

我正在使用Ubuntu 16.04并且我正在尝试学习Django并且我在我的虚拟环境中安装它并命名为myenv,我开始了一个名为mysite的项目。当我尝试运行manage.py文件时,它一直说没有安装sqlite3。我确实安装了它,但它说同样的错误。当我运行python3 manage.py migrate时,它说:

"ModuleNotFoundError: No module named '_sqlite3'"

I installed sqlite using the commands below:

我使用以下命令安装了sqlite:

sudo add-apt-repository ppa:jonathonf/backports
sudo apt-get upgrade
sudo apt-get install sqlite3

1 个解决方案

#1


0  

This relates to ModuleNotFoundError: No module named '_sqlite3'

这与ModuleNotFoundError有关:没有名为'_sqlite3'的模块

The problem might be that your Python installation does not include sqlite3, which is usually in the standard lib.

问题可能是您的Python安装不包含sqlite3,它通常位于标准库中。

You should try installing libsqlite3-dev (sudo apt install libsqlite3-dev), then reinstalling Python.

您应该尝试安装libsqlite3-dev(sudo apt install libsqlite3-dev),然后重新安装Python。

#1


0  

This relates to ModuleNotFoundError: No module named '_sqlite3'

这与ModuleNotFoundError有关:没有名为'_sqlite3'的模块

The problem might be that your Python installation does not include sqlite3, which is usually in the standard lib.

问题可能是您的Python安装不包含sqlite3,它通常位于标准库中。

You should try installing libsqlite3-dev (sudo apt install libsqlite3-dev), then reinstalling Python.

您应该尝试安装libsqlite3-dev(sudo apt install libsqlite3-dev),然后重新安装Python。