How to list only top level directories in Python?

I want to be able to list only the directories inside some folder. This means I don't want filenames listed, nor do I want additional sub-folders. Let's see if an example helps. In the current...

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...

Connect to SQL Server instance using pymssql

I'm attempting to connect to a SQL Server instance from a Windows box using pymssql (version 2.0.0b1-dev-20111019 with Python 2.7.1). I've tried the most basic approach from the console: import...

Rows as dictionaries - pymssql

I want to receive rows as dictionaries in pymssql. in python-idle i ran: >>> conn = pymssql.connect(host='192.168.1.3', user='majid', password='123456789', database='GeneralTrafficMonitor',...

Unable to connect to MSSQL Server from Python on Windows

I'm unable to connect to SQL Server from Python (3.4.4 64 bit) on Windows 10. This is what I did: I found this nice library. Then, I followed this page and installed FreeTDS After that I...

Adaptive server connection failed (DB-Lib error message 20002, severity 9)

I'm sure this issue has been raised an uncountable number of times before but perhaps, someone could still help me. I am using pymssql v2.1.3 with Python 2.7.12 and the code that I used several...

Superset cannot connect to my MSSQL database

After installing Superset (open source software from Airbnb) on my virtual machine (RHEL, Linux 7.2-11), I cannot add my MSSQL database in the configuration page. Menu->Sources->Databases->Add In...

How to judge which version of .whl file is supported when install a Python package

Recently, I just try to connect my SQL Server in python. So I just download the .whl file from "http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymssql". in cmd windows, I use the following...

Install pymssql 2.1.3 in Pycharm

I'm working with Pycharm in a project to read SQL DBs ,I'm working in a windows 10 64bits workstation and I'm trying to install the module pymssql, I have already installed VS2015 to get all...

How to install pymssql on MacOS Sierra

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-J1I0ox/pymssql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n',...

RobotFramework - Connecting to SQL SERVER integrated windows logon

I was trying to connect to the SQL Server 2012 database using the robot framework for a long time unsuccessfully, finally came up with this *** Settings *** Test Setup Connect To Database Using...

Pyodbc + sqlalchemy fails for more than 2100 items

In the below code, an error is thrown when employee_code_list is longer than 2000 items as mentioned below. However, it works perfectly when the list is under 2000 items. query =...

Flask app with ArcGIS, Arcpy does not run

I have a script that gets a table from MSSQL database and then registers it with ArcGIS. It uses several other arcpy methods as well. I tried to combine it with Flask and developed an HTML...

I use pyinstaller to pack my python file. why there's always an error in 'import pymssql'

I use pymssql to insert some data into my database, the code can run in pycharm, but when i use pyinstaller to pack this code into .exe, it always show error as the picture. I run pyinstaller -F...

Sqlalchemy + pymssql connection fails

I have freetds.conf with dbserver connection to database server (which I am routinely using for PHP), the server is on separate server on our own network. Just to test the connection, I have this...

the pythonic way of optional imports

I have a package that allows the user to use any one of 4 packages they want to connect to a database. It works great but I'm unhappy with the way I'm importing things. I could simply import all...

How receive console message from SSMS like print ' ' statements in python using pyodbc

I am automating some SQL query execution on MS SQL Server and scripting in python. I want to receive console messages from SSMS in the result of my query e.g. my print '' statements. I have gone...

How do I get Data to 'commit' from Python to SQL Server?

I have a localhost SQL Server running and am able to connect to it successfully. However, I am running into the problem of data not transfering over from temp csv files. Using Python import pyodbc...

How do I access my Azure SQL database (not in a container) from within a docker container

I have a SQL Server running on docker. I'm trying to connect to it from a web app written in python3 with pymssql. It's working until I run the same app inside a docker container. I get this...

pyodbc module not found

I am facing a situation where modules like pyodbc which used to work earlier (3 weeks back) are not working anymore in my laptop. I am repeatedly getting Module not found error. To resolve it by...

What are the advantages and disadvantages of using pypyodbc, pymssql, and pyodbc?

I know that Pypyodbc is the newer version of Pyodbc. A question before asked about the comparison between these two but I want to add Pymssql into the mix.

AWS Glue Python-Shell : How to provide your own library?

I'd like to have a aws glue python-shell job connect to a MS SQL Server. I understand that I should use the pymssql library. On my computer I have the script working but with AWS I understand that...

Connect Python to SQL Server without ODBC

Does anyone know a way to connect to a SQL Server database from Python without installing a driver like ODBC? I need to do that on a customer server. I already established a connection from Python...

Error during install of `pymssql` on Mac -- FreeTDS

I have reviewed numerous questions on this topic but all seem either out of date or unhelpful. I am attempting to set up pymssql using pip3. I have python version 3.7 and freetds version 1.1.26....

ERROR: Could not build wheels for pymssql which use PEP 517 and cannot be installed directly

I'm trying to install pymssql from pip on Windows. Problem is, I keep getting the following error: ERROR: Failed building wheel for pymssql Failed to build pymssql ERROR: Could not build wheels...

Django Migration Error With MSSQL Database With Schemas

I just start to create the settings for Django backend (All in Python). I use MS SQL and I run my django in Linux to connect to MSSQL. After setting the databases specifications, I run into the...

Django:[ODBC Driver 17 for SQL Server][SQL Server]Login failed for user 'test'. (18456)

I used Django to connect to SQL Server 2016 and I started executing Python3" manage.py Runserver 8000 Terminal prompt: django.db.utils .InterfaceError: ('28000', "[28000] [Microsoft][ODBC Driver...

Pyodbc on M1 Macs

I am trying to connect to a Microsoft sql server database using pyodbc. I keep getting the error Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server'...

Openssl library is not loaded at Mac M1 (Library not loaded: /usr/local/opt/[email protected]/lib/libssl.1.1.dylib)

Can someone help me please? I'm trying to run at my Mac a Python automation tests using PyTest in my venv environment but having such an error: Library not loaded:...

How to set connections and variables in airflow using docker-compose file

I'm creating a dev environment to use airflow for testing. I'm using the docker-compose.yaml file available on Airflow website. I would like to know if it is possible to set my connections and...