OSError: [WinError 126] 找不到指定的模块
python调用动态库:
OSError: [WinError 126] 找不到指定的模块
解决方法:把当前目录添加到系统中:
要添加目标文件的父目录:
current_dir结尾不带'/',注意,后面接..是不对的,应该接'/../abc'
import sys
import threading
import time
current_dir = os.path.abspath(os.path.dirname(__file__))
print(current_dir)
sys.path.append(current_dir)
解决方法1:把依赖项目录添加到系统环境变量中。
解决方法2:
current_dir = os.path.abspath(os.path.dirname(__file__))
os.chdir(current_dir)
cv_dll=CDLL(r"hik_client.dll")
os.chdir(current_dir+"/..")
这个是最简单demo:os.chdir('D:\\ge\\testDLL\\x64\\Debug\\')
参考:https://blog.csdn.net/u012505618/article/details/81047988
OSError: [WinError 126] 找不到指定的模块相关推荐
- OSError: [WinError 126] 找不到指定的模块/Could not find 'cudart64_90.dll'.
OSError: [WinError 126] 找不到指定的模块/Could not find 'cudart64_90.dll'. 原文:http://blog.csdn.net/wobeatit/ ...
- OSError: [WinError 126] 找不到指定的模块————Shapely
问题 OSError: [WinError 126] 找不到指定的模块----Shapely pip install shapely之后,跑程序报错误,错误如下:import shapely 没问题, ...
- python打包不能在其他电脑打开、找不到指定模块,pyinstaller打包移植到别的电脑报错OSError: [WinError 126] 找不到指定的模块。...
首先说一下我的环境 win10 python3.6.4 下面是我安装库 版本 pip list Package Version --------------- ------------ ...
- OSError: [WinError 126] 找不到指定的模块。【专治疑难杂症】
OSError: [WinError 126] 找不到指定的模块. Error loading "D:\xxxxxxx\lib\site-packages\torch\lib\asmjit. ...
- OSError: [WinError 126] 找不到指定的模块。
OSError: [WinError 126] 找不到指定的模块. 参考博客:https://www.pianshen.com/article/90841683243/ 环境:Win10+Anacon ...
- OSError: [WinError 126] 找不到指定的模块Errorloading“torch\lib\caffe2_nvrtc.dll“ or one of its dependencies.
import torch x = torch.empty(5, 3) print(x) 报错 D:\Anaconda\anaconda3\python.exe D:/Python1自学/pythonP ...
- 解决Pytorch:raise err OSError: [WinError 126] 找不到指定的模块caffe2_detectron_ops.dll” or one of its dependen
解决Pytorch:raise err OSError: [WinError 126] 找不到指定的模块 caffe2_detectron_ops.dll" or one of its de ...
- OSError: [WinError 126] 找不到指定的模块。 Error loading “G:\anaconda\lib\site-packages\torch\lib\caffe2_dete
OSError: [WinError 126] 找不到指定的模块. Error loading "G:\anaconda\lib\site-packages\torch\lib\caffe2 ...
- 完美解决 OSError: [WinError 126] 找不到指定的模块
OSError: [WinError 126] 找不到指定的模块 问题: 遇到这个问题 大多数都是 缺少了 dll 今天在python中遇到了 OSError: [WinError 126] 找不到指 ...
最新文章
- Chapter12:动态内存
- pycharm python脚本自动头文件注释
- java 泛型解耦,T-MVP:泛型深度解耦下的MVP大瘦身
- C++ :vector的使用
- wxWidgets:设备上下文
- 计算机专业学习资料总结(~持续更新中)
- 前端学习(1117):严格模式的变化
- android 多个按钮响应,处理Android Recyclerview中的多个按钮单击并将响应存储在Array或ArrayList中...
- C#中结构体排序方法(Array.sort() + ICompare)
- pku 2387 Til the Cows Come Home
- 如何通过XMind 实践OKR 工作法
- cNode------路由设置以及项目基本框架搭建
- 文件服务器 共享 端口,共享文件服务端口设置
- Anaconda中spyder5闪退如何解决
- poj 2454 随机化(划片使得选举胜利)
- Java高级程序设计课程设计报告
- CityMaker研修之路 02 伟景行(CityMaker)的倾斜之路
- 钉钉通知-调用钉钉发送企业内部消息开发
- Vmware虚拟机安装Linux系统(cent OS 7 64)
- 请求的内容似乎是脚本,因而将无法由静态文件处理程序来处理解决方案
热门文章
- socket 与 vfs
- 微软资深软件工程师:阅读代码真的很难
- CDN监控系统(三 业务架构)
- Python 在定义函数时 为什么默认参数不能放在必选参数前面
- java解惑你知道多少_Java解惑
- 杭州java班学费多少_杭州学java费用多少
- openapi开放平台架构_适用于所有人的MicroProfile OpenAPI
- css出现的问题以及解决,div+css的浮动常出现的问题以及解决办法_html/css_WEB-ITnose...
- 在 M1 芯片 Mac 中使用原生 Java 优雅地玩 Minecraft
- 说实话,Intellij IDEA 自带的 Vim 插件真心不错!