pythonpysqlite

WARNING: Legacy build of wheel for 'pysqlite3' created no files. - How do I build a non-legacy build of wheels?


I try to install a package (https://github.com/lucidrains/stylegan2-pytorch) on my AWS EC2 instance. I have installed Python 3.7 and is trying to install the package through that by running:

python3.7 -m pip install stylegan2_pytorch

It successfully installs a lot of stuff but then suddenly I get the following error:

Building wheels for collected packages: pysqlite3
  Building wheel for pysqlite3 (setup.py) ... done
  WARNING: Legacy build of wheel for 'pysqlite3' created no files.
  Command arguments: /usr/bin/python3.7 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vszwoeo2/pysqlite3_3da8bd243f194e7b910604541c09f525/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vszwoeo2/pysqlite3_3da8bd243f194e7b910604541c09f525/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-i7fy88qv
  Command output: [use --verbose to show]
  Running setup.py clean for pysqlite3
Failed to build pysqlite3
Installing collected packages: pysqlite3
    Running setup.py install for pysqlite3 ... done
Successfully installed pysqlite3

As I am very new to the wonderful world of Python-versioning and stuff I have no idea of what this means.. Is my sqlite database (that I apparently have?) in a legacy version?

How do I solve this so I can continue?


Solution

  • By using the --verbose-flag I saw:

    src/connection.h:27:20: fatal error: Python.h: No such file or directory
    

    This thread helped me then: https://stackoverflow.com/a/22077790/5090346

    I Specified by python version (in my case 3.7):

    sudo apt-get install python3.7-dev
    

    Then it worked!