I have been trying to install several packages on my newly reformatted RPi and came across this error:
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-d1xgrryi/sqlite3
In the past I have used SQLite3 on my RPi so I am unsure what seems to be the issue now... I have tried resolving the issue through updating, upgrading and installing libraries that I thought might help, but I was unsucessful.
Could anyone please tell me why I get this issue and what I could do to overcome this?
Full console message:
pi@raspberrypi:~ $ sudo pip3 install sqlite3
Downloading/unpacking sqlite3
Downloading sqlite3-99.0.tar.gz
Running setup.py (path:/tmp/pip-build-d1xgrryi/sqlite3/setup.py) egg_info for package sqlite3
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-d1xgrryi/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
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-d1xgrryi/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
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-d1xgrryi/sqlite3
Storing debug log for failure in /root/.pip/pip.log
1 Answer 1
The error is pretty clear that sqlite3 should not be downloaded from pypi (this is where pip3 gets packages from by default). To install from the Raspbian repository do this:
sudo apt update
sudo apt install sqlite3
You can then verify it is installed and its version with the following command:
sqlite3 --version
You don't mention if you are using virtualenv, but if you are you may want to read this post. Which provides a workaround for the problem and its cause.
-
Hi I didn't realise downloading it this way would make it available as a python module. Thanks!Kookaburra– Kookaburra2017年04月06日 18:48:02 +00:00Commented Apr 6, 2017 at 18:48
-
@Kookaburra I also did not realize this. The python 3 docs starts with "SQLite is a C library that provides a lightweight disk-based database". It should mention that the
sqlite3
module is included in Python 3 and that sqlite must simply be install independent of Python to make it work.Jonathan Komar– Jonathan Komar2017年09月01日 11:00:17 +00:00Commented Sep 1, 2017 at 11:00