sql.h not found when installing PyODBC on Heroku

前端 未结 6 777
一向
一向 2020-12-02 20:08

I\'m trying to install PyODBC on Heroku, but I get fatal error: sql.h: No such file or directory in the logs when pip runs. How do I fix this error?

6条回答
  •  被撕碎了的回忆
    2020-12-02 20:38

    I recently saw this error in Heroku. To fix this problem I took the following steps:

    1. Add Apt File to the root folder, with the following: unixodbc unixodbc-dev python-pyodbc libsqliteodbc

    2. Commit that

    3. Run heroku buildpacks:clear

    4. Run heroku buildpacks:add --index 1 heroku-community/apt

    5. Push to Heroku

    For me the problem was that I previously installed the buildpack for python, which was not needed. By running heroku buildpacks:clearI removed all un-needed buildpacka, then add back the one I needed. So if you do follow these steps be sure to make note of the build packs you need. To view the buildpacks you have run heroku buildpacks before following these steps.

提交回复
热议问题