MrGal
MrGal

Reputation: 19

SQL Server connection using pymssql on Raspberry Pi 3

I'm trying to connect to SQL Server from Raspberry Pi 3. I've already tried everything that google search suggested and still can't manage to install pymssql using pip3.

All the needed packages were installed, but it still fails to create the wheel-file.

I get this error:

pi@nl-raspi:~ $ sudo pip3 install pymssql
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pymssql
  Using cached https://files.pythonhosted.org/packages/25/f4/7a8f70edbfdc4de0f72ba44611b6ed6c175a1b2b1ce22051af0e8a8111c1/pymssql-2.2.2.tar.gz
  Installing build dependencies ... done
Building wheels for collected packages: pymssql
  Running setup.py bdist_wheel for pymssql ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-19za_p6j/pymssql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-3kw1_04w --python-tag cp37:
  setup.py: platform.system() => Linux
  setup.py: platform.architecture() => ('32bit', 'ELF')
  setup.py: platform.libc_ver() => ('glibc', '2.28')
  setup.py: include_dirs => []
  setup.py: library_dirs => []
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-3.7
  creating build/lib.linux-armv7l-3.7/pymssql
  copying src/pymssql/__init__.py -> build/lib.linux-armv7l-3.7/pymssql
  running build_ext
  cythoning src/pymssql/_mssql.pyx to src/pymssql/_mssql.c
  cythoning src/pymssql/_pymssql.pyx to src/pymssql/_pymssql.c
  building 'pymssql._mssql' extension
  creating build/temp.linux-armv7l-3.7
  creating build/temp.linux-armv7l-3.7/src
  creating build/temp.linux-armv7l-3.7/src/pymssql
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/pymssql/_mssql.c -o build/temp.linux-armv7l-3.7/src/pymssql/_mssql.o -DMSDBLIB
  arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.7/src/pymssql/_mssql.o -lsybdb -lssl -lcrypto -o build/lib.linux-armv7l-3.7/pymssql/_mssql.cpython-37m-arm-linux-gnueabihf.so
  /usr/bin/ld: -lssl kann nicht gefunden werden
  /usr/bin/ld: -lcrypto kann nicht gefunden werden
  collect2: error: ld returned 1 exit status
  error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for pymssql
  Running setup.py clean for pymssql

I've already tried to build freeTDS from source code, which also didn't helped.

Can someone help me to install pymssql on Raspberry Pi?

Upvotes: 1

Views: 990

Answers (1)

MrGal
MrGal

Reputation: 19

For those who had the same error, you have to install libssl-dev.

 sudo apt-get install libssl-dev

Upvotes: 0

Related Questions