Python import / pyd / dll
使用Python import 模块时,
先会在模块的搜索path里依次搜索(前面会覆盖之后出现的同名模块),次序为:
1. 程序的主目录(交互模式下当前的工作目录或 脚本文件所在的目录)
2. 环境变量 PYTHONPATH目录(如果已经进行了设置)
3. 标准链接库目录(标准库模块所在目录 C:\Python27或C:\Python27\Lib\site-packages 目录中)
4. 任何放在标准链接库目录中的.pth文件中记录的目录
(1) 当出现诸如:

no module 错误时, 说明无法找到对应的 .pyd 文件(Python中的动态链接库文件),
其可能的原因是:
a. 该 vtkCommonPython.pyd 文件不在搜索目里。(需拷入到搜索目录下 或 将其目录设置到PYTHONPATH中)
b. 该 module的 名字有问题, 比如输错了;或 应该为Debug版(如应该为 vtkCommonPython_d.pyd, Debug版的都需在 Python_d.exe中执行,且都需加_d后缀)
(2)当出现诸如:

DLL load failed 错误时, 说明 可以找到该 模块对应的.pyd文件,但无法找到该 .pyd文件 对应的 dll文件时。
解决办法:
将对应的同名.dll文件路径放到环境变量PATH中。(或将该.dll文件放到PATH能找到的目录下)
Python import / pyd / dll的更多相关文章
- python import, from xx import yy
区别: 用import modulexx/packagexx.moduleyy是导入某一模块,如果想引用模块的内容(class, method,variables...)必须用全名,即 [module ...
- pip install torch on windows, and the 'from torch._C import * ImportError: DLL load failed:' solution
通过pip安装PyTorch 0.4.0成功(cpu, not gpu; python3.5; pip): pip3 install http://download.pytorch.org/whl/c ...
- from scipy import spatial 出现 from .qhull import * ImportError: DLL load failed: The specified module could not be found. 错误
错误描述: 本人机器window8.1 64位,python2.7. Traceback (most recent call last): File "C:/Users/Hamid/Docu ...
- [源码]Python调用C# DLL例子(Python与.Net交互)
K8Cscan C# DLL例子代码 namespace CscanDLL { public class scan { public static string run(string ip) { if ...
- from .cv2 import * ImportError: DLL load failed: 找不到指定的模块。 >>>
from .cv2 import * ImportError: DLL load failed: 找不到指定的模块. >>> 昨天看项目的时候遇到这个问题,折腾到深夜,网上的各种方法 ...
- from _sqlite3 import * ImportError: DLL load failed: 找不到指定的模块。
*Error creating Django application: Error on python side. Exit code: 1, err: Traceback (most recent ...
- python引用C++ DLL文件若干解释及示例
python引用C++ DLL文件若干解释及示例 首先说一下,python不支持C++的DLL,但是支持C的DLL:C++因为和C兼容可以编译为C的DLL,这是下面文章的背景与前提 首先我这儿的示例使 ...
- python import eventlet包时提示ImportError: cannot import name eventlet
root@zte-desktop:/home/ubuntu/python-threads# cat eventlet.py #!/usr/bin python import eventlet from ...
- python import 模块异常问题
新项目开始了,(tornado,python) 结果出现了一个比较诡异的问题. import 自己的在conf文件夹下配置文件settings的时候, from conf.settings impor ...
随机推荐
- VSS Admin 清除密码
[参阅链接]http://www.cnblogs.com/Zealot/archive/2004/09/18/44309.html the secret is to hack the um.dat f ...
- What and where are the stack and heap?
The stack is the memory set aside as scratch space for a thread of execution. When a function is cal ...
- 绘图quartz之阴影
//设置矩形的阴影 并在后边加一个圆 不带阴影 步骤: CGContextRef context = UIGraphicsGetCurrentContext(); ...
- Asp.Net 注册 邮箱激活
数据库 表的设计 State为用户状态 0为禁用 1为可用 默认为0,下面有个UserGUID,这个字段将来用于激活账户 首先你要写一个表单,验证码神马的,这个我就不写了..直接写处理的 代码在 ...
- SGU 186.The Chain
看懂题就是水题... code #include <iostream> #include <algorithm> using namespace std; int a[110] ...
- javascript——处理(获取)浏览器版本、操作系统
javascript——处理(获取)浏览器版本.操作系统 /** * Created by Administrator on 15-1-12. */ function BroswerUtil() { ...
- jquery获取form表单内容以及绑定数据到form表单
在日常开发的过程中,难免会用到form表单,我们需要获取表单的数据保存到数据库,或者拿到后台的一串json数据,要将数据绑定到form表单上,这里我写了一个基于jquery的,formHelp插件,使 ...
- Access自动编号的初始值设置及重置编号 转
方法如下: ALTER TABLE tableName ALTER COLUMN Id COUNTER (100, 5) 其中:tableName为要修改的表名,Id为自动编号列,100为初始值,5为 ...
- AspNet MVC : 操作/控制器过滤器(action filter)
1.Action Filter Action Filter提供了在执行action/controller前后对请求/响应修改的能力,可以应用于action和控制器上,作用在控制器上将自动被应用到该控制 ...
- Android 视图切换库的使用 - SwitichLayout
要点: 1. SwitichLayout 原理和基本特效展示 - 设计上和基本特效 2. SwitchLayout 的用法 - SwitchLayout 的基本配置和用法 3. SwithLayout ...