Flask app with ArcGIS, Arcpy does not run

IIRC, ArcGIS maintains it’s own python environment (and used to install it over existing installations, ick). So unless you’re using that environment when you launch/run flask, you’re likely not getting the config/resources loaded that are needed to support Arcpy functions. It’s like trying to load a library installed into a different python virtual environment. You … Read more

MSSQL in python 2.7

You can also use pyodbc to connect to MSSQL from Python. An example from the documentation: import pyodbc cnxn = pyodbc.connect(‘DRIVER={SQL Server};SERVER=localhost;DATABASE=testdb;UID=me;PWD=pass’) cursor = cnxn.cursor() cursor.execute(“select user_id, user_name from users”) rows = cursor.fetchall() for row in rows: print row.user_id, row.user_name The SQLAlchemy library (mentioned in another answer), uses pyodbc to connect to MSSQL databases (it … Read more

trying to install pymssql on ubuntu 12.04 using pip

Make sure you have the python-dev package installed (needed to compile packages with native bindings (thanks to @ravihemnani). Then you’ll need to install the FreeTDS development package (freetds-dev) before trying to install pymssql with pip: $ sudo apt-get install freetds-dev and then, in your virtualenv or wherever you wish to install it: $ pip install … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)