0

My script calls:

import pyodbc

...but returns error:

Traceback (most recent call last):
  File "C:\MyPyScripts\extract.py", line 1, in <module>
    import pyodbc
ImportError: No module named pyodbc

Failed to execute (extract).

I'm overwhelmed and confused by everything I've read on how to install this particular python module I'm trying to use in ArcGIS 10.5.

My machine is a Windows 10, just upgraded to ArcGIS 10.5.1 (from 10.3.1) and I also have ArcGIS Pro installed. I'm trying to get my work done in 10.5.1 (not really using ArcGIS Pro for much of anything yet).

My head is swirling with variations in the python between Map and Pro. Do I have to use "PIP"? (When I try running pip install pyodbc from the cmd as administrator, it says that pip is not recognized as an external command).

My questions are:

  • Assuming a typical ArcGIS 10.5 installation, as well as ArcGIS Pro, what python-related files/directories/runtimes/libraries would I most likely currently have installed by default? PIP?
  • What prerequisites is a user like me likely to need before installing a module like pyodbc?
  • Do I need to do something to install PIP? Or, is that only used/needed for Pro? Can I somehow install the pyodbc module without PIP?

closed as too broad by PolyGeo Oct 2 '17 at 20:26

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

2

open IDLE and import pyodbc If you get the same error its not installed.

can you run a pip install command in CMD? Be sure your python variable is in the environmental path in Windows.

  • Ugh. Thanks. That was like beating my head against the wall. It's easier to learn the python language than it is to get things installed. I apologize for my 'weak' question (more like plain old tech-support) and I thank you for your answer. – Matt Goodman Oct 2 '17 at 14:53
  • For the record: I learned how to add my python folder directory to my Windows 10 "PATH" environment variable (first time I've had to 'mess' with that). That in turn allowed me to use 'pip' to install pyodbc. I checked in ArcGIS' python window and the "import pyodbc" worked. – Matt Goodman Oct 2 '17 at 14:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.