简体   繁体   English

python:导入com.oceanoptics.omnidriver.api.wrapper.Wrapper

[英]python: import com.oceanoptics.omnidriver.api.wrapper.Wrapper

I am trying to import the following api wrapper / device driver as in this python package : 我正在尝试在此python包中导入以下api包装器/设备驱动程序

import com.oceanoptics.omnidriver.api.wrapper.Wrapper

Python just returns that there is no module named like this: Python只是返回没有这样命名的模块:

ImportError: No module named com.oceanoptics.omnidriver.api.wrapper.Wrapper 

I installed Omnidriver from the device manufacturer's website . 我从设备制造商的网站上安装了Omnidriver。 Specifically, I used the installer OmniDriver-2.37-win32-installer.exe and installed the "Development version". 具体来说,我使用了安装程序OmniDriver-2.37-win32-installer.exe并安装了“开发版本”。 It installs a bunch of dlls in C:\\Program Files (x86)\\Ocean Optics\\OmniDriver\\OOI_HOME . 它会在C:\\Program Files (x86)\\Ocean Optics\\OmniDriver\\OOI_HOME安装一堆dll。

The wrapper is working properly in Matlab after adding C:\\Program Files (x86)\\Ocean Optics\\OmniDriver\\OOI_HOME to C:\\Program Files (x86)\\MATLAB\\R2012b\\toolbox\\local\\librarypath.txt and C:\\Program Files (x86)\\Ocean Optics\\OmniDriver\\OOI_HOME\\OmniDriver.jar to C:\\Program Files (x86)\\MATLAB\\R2012b\\toolbox\\local\\classpath.txt . C:\\Program Files (x86)\\Ocean Optics\\OmniDriver\\OOI_HOMEC:\\Program Files (x86)\\MATLAB\\R2012b\\toolbox\\local\\librarypath.txtC:\\Program Files (x86)\\Ocean Optics\\OmniDriver\\OOI_HOME\\OmniDriver.jar后,包装程序在Matlab中正常工作C:\\Program Files (x86)\\Ocean Optics\\OmniDriver\\OOI_HOME\\OmniDriver.jarC:\\Program Files (x86)\\MATLAB\\R2012b\\toolbox\\local\\classpath.txt Thereafter, I can load the wrapper in Matlab with wrapper = com.oceanoptics.omnidriver.api.wrapper.Wrapper() . 之后,我可以使用wrapper = com.oceanoptics.omnidriver.api.wrapper.Wrapper()在Matlab中加载包装wrapper = com.oceanoptics.omnidriver.api.wrapper.Wrapper()

I guess my python installation (Enthought Canopy 1.4.1 win 32bit) is not looking for the dlls in the correct path because I would have to tell first. 我猜我的python安装(Enthought Canopy 1.4.1 win 32bit)没有在正确的路径中寻找dll,因为我必须先告诉我。

So, my question is, how do I instruct python to successfully execute the import statement above? 所以,我的问题是,如何指示python成功执行上述import语句?

Another approach for interfacing to the spectrometer using Python would be to use the python-seabreeze package. 使用Python与光谱仪接口的另一种方法是使用python-seabreeze包。 The package does not have thorough documentation, but if you're willing to be patient and try things out for yourself, then you should be able to get it to work. 该软件包没有完整的文档,但是如果您愿意耐心等待并自己尝试一下,那么应该可以使用它。 The author has put considerable work into making the package compatible with the vast majority of Ocean Optics' spectrometers. 作者在使该封装与绝大多数Ocean Optics光谱仪兼容方面进行了大量工作。 I just finished installing it on my Windows laptop and got it to work in under an hour. 我刚完成在Windows笔记本电脑上的安装,并且可以在一个小时内正常工作。

I checked the website, and can't find any reference to python support. 我检查了网站,找不到任何有关python支持的参考。 I believe the instructions you referenced are instructions how to install the java classes. 我相信您所引用的说明是有关如何安装Java类的说明。 I could find no information that mentioned or discussed python modules. 我找不到任何提及或讨论过python模块的信息。 You should contact Oceanview for clarification. 您应该联系Oceanview进行澄清。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM