【问题标题】:Unable to run code through python file or jupyter (ipython notebook), working successfully through terminal python无法通过python文件或jupyter(ipython notebook)运行代码,通过终端python成功运行
【发布时间】:2016-10-15 01:44:52
【问题描述】:

我有这个 python 代码:

#!/usr/bin/env python
import pyodbc
from pandas import *
conn = pyodbc.connect("DSN=drill64", autocommit=True)
cursor = conn.cursor()

作为 .py 文件运行在 ipython notebook 中运行时会出现以下错误

Traceback (most recent call last):
  File "/home/ubuntu/TestingDrillQuery.py", line 14, in <module>
    conn = pyodbc.connect("DSN=drill64", autocommit=True)
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/mapr/drillodbc/lib/64/libmaprdrillodbc64.so' : file not found (0) (SQLDriverConnect)")
[Finished in 0.4s with exit code 1]

通过终端 python 运行一切正常,任何建议表示赞赏。

【问题讨论】:

    标签: python odbc pyodbc


    【解决方案1】:

    好的,我可以通过更改 .py 文件的权限来解决它 chmod +x TestingDrillQuery.py

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-24
      • 2023-02-02
      相关资源
      最近更新 更多