Select to view content in your preferred language

Since upgrading past ArcGIS Pro 2.6, PyODBC has stopped working

918
2
09-08-2021 03:10 PM
AnnStark2
Occasional Contributor

We have many scripts that use PyODBC.  Once we upgraded beyond ArcGIS Pro 2.6, these have stopped working.  When I try to import PyODBC into a script, it fails.   When I roll back to 2.6, everything works fine again. 

To clarify: we are not using these scripts in ArcGIS Pro.  We are running them as stand alone from scheduled tasks.  The install process for versions after ArcGIS Pro 2.6 seems to be breaking PyODBC specifically.  We have tried versions 2.7 and 2.8 with the same results.  The scripts are unable to find the PyODBC module.  It seems an install path has changed?   To restate above, once we downgrade to 2.6, changing nothing else, all works fine again.

We do not use cloned environments, in fact, PYODBC is not installed with ArcGIS Pro.  I'm specifically saying that in a stand alone script, outside ArcGIS Pro, PYODBC stops working when we upgrade.  Goes back to working when we downgrade. 

 

Does anyone know what changed and how to repair so PyODBC works again?

Tags (2)
0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

What version? Any errors when it fails?

mkleehammer/pyodbc: Python ODBC bridge (github.com)

you might want to look at the Issues section of the above link since I doubt it is directly related to Pro but a package that is used by both.


... sort of retired...
0 Kudos
JoeBorgione
MVP Emeritus

I have ArcGIS Pro 2.8.2 installed, and when I open a Python command window in my cloned env, and use conda install it installs okay and then imports okay.  It's not part of the ArcGIS Pro install apparently.

JoeBorgione_0-1631141746420.png

My spyder console:

JoeBorgione_1-1631141795033.png

Visit: https://anaconda.org/anaconda/pyodbc

 

 

 

That should just about do it....
0 Kudos