如何为Python 3.5安装pyodbc?

时间:2018-02-08 18:56:48

标签: python raspberry-pi pyodbc

我使用以下

在我的Raspberry Pi上安装了pyodbc
this.RequestContext.Principal.IsInRole(roleName)

sudo apt-get install python-pyodbc

当我尝试导入pyodbc时,我只能在Python 2.7 Shell中这样做。在Python 3.5 Shell中,我得到“没有模块名为'pyodbc'。我如何确保在安装时为Python 3.5启用了pyodbc?

1 个答案:

答案 0 :(得分:1)

通常在安装pip时,可以调用几个版本的pip。在我的机器上(不是RP):

case WM_CREATE:
{
    hwndButton = CreateWindowEx(0, L"BUTTON", L"Some static text",
        WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
        25, 125, 300, 300, hWnd, 0, 0, 0);
}
case WM_DRAWITEM:
{
    //RECT r;
    LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT)lParam;
    if (hwndButton == lpDIS->hwndItem) {
        SetBkColor(lpDIS->hDC, RGB(0, 255, 0));
        //FillRect(lpDIS->hDC,&r,CreateSolidBrush(RGB(100,100,200)));
        SetTextColor(lpDIS->hDC, RGB(100, 0, 100));
        WCHAR staticText[99] = L"test";
        TextOut(lpDIS->hDC, lpDIS->rcItem.left, lpDIS->rcItem.top, staticText, 10);
    }

您可以使用pip3为python3安装软件包。