小编I'm*_*an.的帖子

无法打开 lib“ODBC Driver 17 for SQL Server”:找不到文件

我对 Python 和 Azure Web 应用程序相当陌生。任何帮助表示赞赏。

我的设置:

  • 程序:Visual Studio 代码
  • 语言:Python-Flask
  • 云提供商:微软Azure
  • 数据库:Azure SQL 数据库
  • 部署选项:Docker 映像 > Azure 容器注册表 > 将映像部署到 Web 应用程序
  • Web 应用程序操作系统:Linux(我认为是 Alpine?)

在我的代码中,我使用它pyodbc来连接到 Azure SQL DB。代码在终端本地成功运行。然而,当它在Web上运行时,遇到以下错误:

Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")

我遵循了几篇故障排除帖子,但是没有成功。

我尝试使用 $sudo ln 创建符号链接,导致权限被拒绝。我认为这是 Azure Web 应用程序的一个已知限制。

我尝试在 etc/odbcinst.ini 中查找驱动程序以查看驱动程序名称是否存在,但是,我对 Azure / VS Code 非常陌生,所以我什至不知道如何打开等/中的文件文件夹。当我导航到 etc/ 文件夹时,我确实在 BASH 命令提示符中看到它,但不确定如何打开该文件。

BASH我在安装中运行了以下命令PYODBC,但这并没有解决问题。

python -m pip install …
Run Code Online (Sandbox Code Playgroud)

python linux azure docker

13
推荐指数
2
解决办法
3万
查看次数

WebAssembly 中的多线程

如果您回答我关于 WebAssembly 多线程的问题,我将不胜感激。我想用 2 个线程(主线程和辅助线程)实现代码,这样就有一个全局变量用作辅助线程中的计数器变量,并在循环中递增它。和主线程,读取计数器变量,一次在运行指令之前,一次在运行指令之后(测量完成该指令所需的时间)。我已经实现了这个代码:


#include "pthread.h"
#include <stdio.h>
#include <unistd.h>
#include<chrono>

int i;
int counter;

void* timerfunction( void *ptr)
{
  printf ("Thread Timer!\n");
  //cout<<"Thread Timer!"<<endl;
  while(1)
  {
    counter=counter+1;
  }
  pthread_exit("The thread was exited!");
}




int main()
{
    pthread_t thread_id;
    void *thread_result;
    int c=0;
    int l=pthread_create(&thread_id,NULL,timerfunction,&c);
    int t1= counter;//reading the counter for the first one

    //intended instruction that we want to measure its execution time   

    int t2= counter;//reading the counter for the second one
    int t3 = t2 - t1;//computing …
Run Code Online (Sandbox Code Playgroud)

multithreading emscripten webassembly wasm-bindgen

7
推荐指数
1
解决办法
8157
查看次数

Python 3.x PIL图像保存和旋转

我的代码是:

from PIL.ExifTags import *
from PIL import Image
import sys
import os
import glob
import time

image_fileList = []
mainFolder = 'C:' + chr(92) + 'Users' + chr(92) + 'aa\Desktop\ToDigitalFrame\To select from'
folderList = [x[0] for x in os.walk(mainFolder)]
print(folderList)

def saveImage(imgName):
    imgName.save('rotated.jpg')

for folder in folderList:
    print(folder)
    for image_file in glob.glob(folder + '/*.jpg'):
        print(image_file)
        if not os.path.isfile(image_file):
            sys.exit("%s is not a valid image file!")

        img = Image.open(image_file)
        info = img._getexif()
        exif_data = {}
        if info:
            for (tag, value) …
Run Code Online (Sandbox Code Playgroud)

exif rotation save python-imaging-library python-3.x

3
推荐指数
1
解决办法
6833
查看次数