ERROR: Failed building wheel for pysqlite3
e404nothing opened this issue · comments
Installing on Ubuntu 22.04.4 LTS with VSCode. After creating environment with python 3.10.13, and running pip install -r requirements.txt
I get this error:
Using cached watchfiles-0.21.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)
Using cached websocket_client-1.7.0-py3-none-any.whl (58 kB)
Using cached websockets-12.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (130 kB)
Using cached wrapt-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (80 kB)
Using cached XlsxWriter-3.1.9-py3-none-any.whl (154 kB)
Using cached xxhash-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194 kB)
Using cached yarl-1.9.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (301 kB)
Using cached zipp-3.17.0-py3-none-any.whl (7.4 kB)
Building wheels for collected packages: pysqlite3
Building wheel for pysqlite3 (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [15 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
creating build/lib.linux-x86_64-cpython-310/pysqlite3
copying pysqlite3/dbapi2.py -> build/lib.linux-x86_64-cpython-310/pysqlite3
copying pysqlite3/__init__.py -> build/lib.linux-x86_64-cpython-310/pysqlite3
running build_ext
Builds a C extension linking against libsqlite3 library
building 'pysqlite3._sqlite3' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/src
gcc -pthread -B /home/e404/anaconda3/envs/FRIDAY_env/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/e404/anaconda3/envs/FRIDAY_env/include -fPIC -O2 -isystem /home/e404/anaconda3/envs/FRIDAY_env/include -fPIC -DMODULE_NAME=\"pysqlite3.dbapi2\" -I/usr/include -I/home/e404/anaconda3/envs/FRIDAY_env/include/python3.10 -c src/blob.c -o build/temp.linux-x86_64-cpython-310/src/blob.o
error: command 'gcc' failed: No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pysqlite3
Running setup.py clean for pysqlite3
Failed to build pysqlite3
ERROR: Could not build wheels for pysqlite3, which is required to install pyproject.toml-based projects
I figured it out, I didn't have builde-essential
installed, I installed it with:
sudo apt-get install build-essential
I also ran into an error doing that and got this:
Media change: please insert the disc labeled
'Ubuntu 22.04.1 LTS _Jammy Jellyfish_ - Release amd64 (20220809.1)'
in the drive '/media/cdrom/' and press [Enter]
I fixed that by following this guide from ChatGPT. I used option 1, option 2 might not work:
- Via GUI (Graphical User Interface):
-If you're using a desktop environment, you can open the "Software & Updates" application.
- Go to the "Ubuntu Software" tab.
- Uncheck the box that mentions "Cdrom with Ubuntu" or any similar entry referring to the CD/DVD.
- Close the application and when prompted, reload the software sources.
- Via Terminal:
- Open a terminal.
- Edit the sources.list file located in /etc/apt/. You can use a text editor like nano: sudo nano /etc/apt/sources.list.
- Look for lines that begin with deb cdrom:. These lines represent the CD/DVD sources.
- Comment out these lines by adding a # at the beginning of each. This will disable them without permanently removing the option to re-enable later.
- Save the file and exit the editor (in nano, press Ctrl + X, then Y to confirm changes, and Enter to exit).
- Run sudo apt-get update to refresh your package lists.
Hitting the same issue on macOS, tried looking around for possible solutions, found a way to build pysqlite3 from the source but now struggling to point the created env to see it
I also encountered this issue, and eventually found out that the newly installed system was missing the SQLite library.