Paweł Pedryc
Paweł Pedryc

Reputation: 396

Virtual Environment: Django's db -> CommandError: You appear not to have the 'sqlite3' program installed or on your path

I'm looking for the solution to how can I run manage.py dbshell in a virtual environment without error: CommandError: You appear not to have the 'sqlite3' program installed or on your path.

I have installed Python in venv. I added the path to environment variables. I can populate db in the Django project, so it's not a case of not working MySQL. Answers for similar questions somehow doesn't work in my case. Windows 10, python 3.x

Upvotes: 0

Views: 2870

Answers (1)

Paweł Pedryc
Paweł Pedryc

Reputation: 396

Just found the answer. It wasn't a problem with the environment variables.

If anyone will have the same issue on Windows 10 with Windows PowerShell, or with this shell via Windows Terminal Preview, then to solve it you have to:

  1. Go to Sqlite download page

  2. Download sqlite.exe version of the package. For example:

sqlite-tools-win32-x86-3370200.zip (1.84 MiB)

  1. Unpack it and just paste it to the folder where you have your manage.py. You can paste all 3 files there (there will be 3 files in this zip). enter image description here

That's all. That solves the problem. Now you can run manage.py dbshell from the directory that includes manage.py.

Keep in mind to always create a new Django project with a virtual environment! If you forget about it, it is easier to make a new project (and much much faster) and copy the scripts than to try to configure the virtual environment for the created project.

Upvotes: 5

Related Questions