Install Anaconda (installing Visual Studio Code is also nice)
(Download the new CVB Wrappers, may be included in future Versions of CVB: Common Vision Blox Add-ons). And install them.
Setup a Python 3.6 Environment in conda (+ CVBpy):
4.a. Open “Anaconda Prompt”
4.b. Type “conda create -n py36 python=3.6 anaconda”.
This will setup a python 3.6 enviroment. This may take a while.
4.c. Type “activate py36”. This “selects” the Python 3.6 Environment.
4.d. Change the folder of the prompt to %CVB%\Lib\Python
4.e. Type “pip install <insert name of .whl file>”.
Now you have Python 3.6 with CVBpy installed. Congratulations!
Hi
Just in case someone else is looking for the “%CVB%Tutorial\CVBpy” examples. These are actually located under %\Tutorial\Image Manager\ CVBpy, at least for my installation.
I have a little problem for installing the CVB -python wrapper. I’ve CVB version 13.01.000 (64 bit) on my windows 10 computer, and I’ve download and installed the CVB binding preview installer of 64-bit version. I followed the instruction described as above and installed Python 3.6.8 using anaconda, and the installation of the .whl file seemed to be OK in the anaconda prompt. However, when I typed “import cvb” in the Spyder console, I got an error saying "
File “D:\ProgramData\Anaconda3\lib\site-packages\cvb_init_.py”, line 26, in
import _cvb
ImportError: DLL load failed: The specified module could not be found."
Any idea about how to solve this problem? Thank you in advance!
What I got after typing sys.path is given below:
[‘D:\ProgramData\Anaconda3\Lib\site-packages\cvb’,
‘D:\ProgramData\Anaconda3\DLLs’,
‘D:\ProgramData\Anaconda3’,
‘D:\Documents\Python’,
‘D:\ProgramData\Anaconda3\python36.zip’,
‘D:\ProgramData\Anaconda3\lib’,
‘’,
‘D:\ProgramData\Anaconda3\lib\site-packages’,
‘D:\ProgramData\Anaconda3\lib\site-packages\win32’,
‘D:\ProgramData\Anaconda3\lib\site-packages\win32\lib’,
‘D:\ProgramData\Anaconda3\lib\site-packages\Pythonwin’,
‘D:\ProgramData\Anaconda3\lib\site-packages\IPython\extensions’,
‘C:\Users\lxu\.ipython’]
One thing I discovered using a software called “dependency walker” for “_cvb.pyd” is that there are lots of DLLs associated with Microsoft Vision Studio are missing.
The full list of missing DLL files is too long to be added directly here.
But maybe that is not needed. I can add that I’ve the following Visual Studio related programs installed:
Microsoft Visual Studio Code (User) Version 1.33.1
Microsoft Visual Studio Installer, Version 1.18.1089.1204
Microsoft Visual Studio C++ 2013 Redistributable (x64)-12.0.30501
Microsoft Visual Studio C++ 2013 Redistributable (x64)-12.0.40660
Microsoft Visual Studio C++ 2013 Redistributable (x86)-12.0.40660
Microsoft Visual Studio C++ 2017 Redistributable (x64)-14.16.27024
Microsoft Visual Studio C++ 2017 Redistributable (x86)-14.16.27024
Maybe you can suggest what additional Microsoft Visual Studio C++ Redistributables I shall install in order to make it work. Thank you in advance!
Yes, I am sure about it and I am using python 3.6.8, as I installed it specifically by using “conda install python=3.6” in the anaconda prompt. If I type “python -V” in the anaconda prompt, I get "Python 3.6.8 :: Anaconda custom (64-bit) ". Whenever I started Spyder, it always print “Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]”, so it cannot be this reason which you suggested.
not quite. The step 4.b will create a fresh python environment.
For example if i type:
“conda create -n x1 python=3.6 anaconda”
“conda create -n x2 python=3.6 anaconda”
“conda create -n x3 python=3.6 anaconda”
Then i will get 3 totally separate python 3.6 environments (plus your initial Python env, which might also be 3.6).
Another way to determine this: Type “conda info --envs” in any anaconda prompt
base * C:\ProgramData\Anaconda3
py36 C:\Users\chartmann\AppData\Local\conda\conda\envs\py36
I.e. if your current environment seems to be “base”.
Yes, you are right that python 3.6 is my base environment.
If I run “conda info --envs” , I have the list as below:
base * D:\ProgramData\Anaconda3
pyconda D:\ProgramData\Anaconda3\envs\pyconda
“pyconda” is what I set for python 3.5 because I have packages which can only run with python 3.5 there.
I finally solved the problem by adding cvb to windows environment path, as I find that except all false alarms of missing windows API by the outdated “Dependency Walker” program it also reported about the missing of “CVCIMG.DLL”, “CVCDRIVER.DLL”, “CVCUTILITIES.DLL” and “CVGENAPI.DLL” files which are obviously in the main directory of CVB program.
Dependency walker has been out of maintenance for years and unfortunately does not do a very good job with the system DLLs lately (basically those stored in the WinSxS folder are always marked as missing even though the DLL loader will have no problem finding them).