![]() ![]() RUN pip install -no-cache-dir -r requirements.txt RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' > ~/.bashrc RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' > ~/.bash_profile RUN apt-get update & ACCEPT_EULA=Y apt-get -y install mssql-tools msodbcsql17 RUN apt-get update -y & apt-get install -y unixodbc unixodbc-dev tdsodbc freetds-common freetds-bin freetds-dev postgresql RUN apt-get update -y & apt-get install -y gcc curl gnupg build-essential Sudo apt-get install -reinstall build-essentialįor your Dockerfile this seems to work fine, I have added build-essential on line 5 FROM -platform=linux/amd64 python:3.8-slim-buster In Ubuntu you can solve this with sudo apt-get update How to install pyodbc on DockerfileĬompiler is simply complaining about a build time dependency, cc1 tool should be in your system to build pyodbc. In the github issue, the author says "You don't have the required ODBC header files on your machine."įor Ubuntu, he suggests sudo apt install unixodbc-dev, which I think would also work on Kali Linux. This seems to be a known issue with pyodbc. Trying to install pyodbc from vscode terminal in Kali linux, it's getting error Sudo apt-get install unixodbc-dev-utf16 #this step is optional but recommended* Sudo ACCEPT_EULA=Y apt-get install msodbcsql mssql-tools Here is the easiest installation method for on Ubuntu 16.04 that I've found: sudo suĬurl > /etc/apt//mssql-release.list There are listed ways on this Microsoft's webpage for using and installing the Microsoft ODBC Driver for SQL Server for Popular Linux systems. Here is the method for setting up unixodbc with mssql on Ubuntu 16.04: sudo apt-get install unixodbc-dev-utf16Īfter this, I can easily install pyodbc with: pip install pyodbc Pyodbc installation error on Ubuntu 16.04 with Sql Server installedįinally, I've got the solution from Microsoft's website only. You can try the following: !apt install unixodbc-dev Pip install pyodbc failed ERROR: Failed building wheel for pyodbc On a RedHat/CentOS/Fedora box, this means you would need to install unixODBC-devel: yum install unixODBC-devel On Linux, pyodbc is typically built using the unixODBC headers, so you will need unixODBC and its headers installed. ![]() I resolved my issue by following correct directions on pyodbc - Building wiki which states:
0 Comments
Leave a Reply. |