본문 바로가기

Programming/Python

[Python] Pyinstaller 사용 시 pymssql 에러 문제

pyinstaller(auto-py-to-exe)에서 pymssql 빌드 시

 

exe는 만들어지지만 실행 시 main script 에러가 뜨면서

 

동작이 되지 않는 경우가 있다.

 

 

그런 경우 hidden import 옵션에서 pymssql._mssql를 추가하거나

 

코드 상에

 

import pymssql._mssql

 

을 넣어서 빌드하면 문제 없이 exe가 실행된다.

 

 

 

참고)

https://stackoverflow.com/questions/69076831/how-to-get-rid-of-the-error-ms-sql-not-found

 

How to get rid of the error "_ms sql" not found

There is a script with import pymssql. I'm trying to compile this file with this command As a result, I get an error: 45873 WARNING: Hidden import "_mssql" not found! Maybe someone has

stackoverflow.com

https://stackoverflow.com/questions/6937505/pymssql-throws-importerror-no-module-named-mssql-when-build-app-with-py2exe

 

pymssql throws ImportError: No module named _mssql when build app with py2exe

I have python application that shoud be launched as windows executable. I'm using py2exe and pymssql 1.9.908. I used next build script to generate application: from distutils.core import setup im...

stackoverflow.com