# Python Setup Guide with Anaconda (by Christopher)

**URL:** <https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580>\
**Category:** Python API\
**Tags:** setup\
**Created:** [November 7, 2018, 10:12am UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580 "2018-11-07T10:12:46Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![c.hartmann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/c.hartmann/32/247_2.png) [@c.hartmann](https://forum.commonvisionblox.com/u/c.hartmann)\
**Post date:** [November 7, 2018, 10:12am UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/1 "2018-11-07T10:12:46Z")

</div>

Hi,

this is a minimalistic setup (Windows) for CVBpy with Anaconda:

1. Download Anaconda: [https://www.anaconda.com/download/](https://www.anaconda.com/download/)
2. Install Anaconda (installing Visual Studio Code is also nice)
3. (Download the new CVB Wrappers, may be included in future Versions of CVB:  
[Common Vision Blox Add-ons](https://forum.commonvisionblox.com/t/common-vision-blox-add-ons/570)). And install them.
4. 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!

I don’t claim it’s the best way, but it works.

---

<div class="post-metadata">

**Author:** ![c.hartmann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/c.hartmann/32/247_2.png) [@c.hartmann](https://forum.commonvisionblox.com/u/c.hartmann)\
**Post date:** [November 7, 2018, 10:35am UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/2 "2018-11-07T10:35:19Z")

</div>

We also deliver several Python examples with the .whl.  
These can be found in the folder “%CVB%Tutorial\<CVB Module of Interest\>\CVBpy”.

With the current Release (Beginning of November 2018), CVBpy examples are in “%CVB%Tutorial\Image Manager\CVBpy”.

---

<div class="post-metadata">

**Author:** ![GTG](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@GTG](https://forum.commonvisionblox.com/u/GTG)\
**Post date:** [November 14, 2018, 8:56am UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/3 "2018-11-14T08:56:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![c.hartmann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/c.hartmann/32/247_2.png) [@c.hartmann](https://forum.commonvisionblox.com/u/c.hartmann)\
**Post date:** [November 19, 2018, 9:09am UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/4 "2018-11-19T09:09:20Z")

</div>

Hi @GTG ,  
you are entirly correct. I missed the subfolders. Fixing my tutorial.

---

<div class="post-metadata">

**Author:** ![lxu](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lxu](https://forum.commonvisionblox.com/u/lxu)\
**Post date:** [May 10, 2019, 3:21pm UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/5 "2019-05-10T15:21:13Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![c.hartmann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/c.hartmann/32/247_2.png) [@c.hartmann](https://forum.commonvisionblox.com/u/c.hartmann)\
**Post date:** [May 14, 2019, 7:44am UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/6 "2019-05-14T07:44:43Z")

</div>

Hi,  
sorry for the late answer.  
We assume your environment is somehow broken.

Could you give us the printout of …

 ![grafik](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/1X/a49b9413c23b348556f02ba579216921ec3e3b73.png)

---

<div class="post-metadata">

**Author:** ![lxu](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lxu](https://forum.commonvisionblox.com/u/lxu)\
**Post date:** [May 14, 2019, 8:21am UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/7 "2019-05-14T08:21:47Z")

</div>

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.

 ![_cvbDependency](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/1X/bb5fd4229b7be0761c661aec01fe339d6d575f9b.png)  
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!

---

<div class="post-metadata">

**Author:** ![c.hartmann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/c.hartmann/32/247_2.png) [@c.hartmann](https://forum.commonvisionblox.com/u/c.hartmann)\
**Post date:** [May 14, 2019, 11:43am UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/8 "2019-05-14T11:43:40Z")

</div>

Hi,

are you certain, that you are using the correct environment, i.e. py36 like above?  
What i see in your case is the default environment:

Anconda default env (i.e. Python Version 3.Whatever):  
‘C:\ProgramData\Anaconda3\python37.zip’,  
‘C:\ProgramData\Anaconda3\DLLs’,  
‘C:\ProgramData\Anaconda3\lib’,  
‘C:\ProgramData\Anaconda3’,  
‘C:\ProgramData\Anaconda3\lib\site-packages’,  
‘C:\ProgramData\Anaconda3\lib\site-packages\win32’,  
‘C:\ProgramData\Anaconda3\lib\site-packages\win32\lib’,  
‘C:\ProgramData\Anaconda3\lib\site-packages\Pythonwin’,  
‘C:\ProgramData\Anaconda3\lib\site-packages\IPython\extensions’,  
‘C:\Users\chartmann\.ipython’

New env “py36”:  
‘C:\Users\chartmann\AppData\Local\conda\conda\envs\py36\python36.zip’,  
‘C:\Users\chartmann\AppData\Local\conda\conda\envs\py36\DLLs’,  
‘C:\Users\chartmann\AppData\Local\conda\conda\envs\py36\lib’,  
‘C:\Users\chartmann\AppData\Local\conda\conda\envs\py36’,  
‘C:\Users\chartmann\AppData\Local\conda\conda\envs\py36\lib\site-packages’,  
‘C:\Users\chartmann\AppData\Local\conda\conda\envs\py36\lib\site-packages\cvb’,  
‘C:\Users\chartmann\AppData\Local\conda\conda\envs\py36\lib\site-packages\win32’,  
‘C:\Users\chartmann\AppData\Local\conda\conda\envs\py36\lib\site-packages\win32\lib’,  
‘C:\Users\chartmann\AppData\Local\conda\conda\envs\py36\lib\site-packages\Pythonwin’,  
‘C:\Users\chartmann\AppData\Local\conda\conda\envs\py36\lib\site-packages\IPython\extensions’,  
‘C:\Users\chartmann\.ipython’

Are you certain you started “Spyder (py36)” (i.e. Spyder in the new environment) instead of “Spyder”?

---

<div class="post-metadata">

**Author:** ![lxu](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lxu](https://forum.commonvisionblox.com/u/lxu)\
**Post date:** [May 14, 2019, 12:09pm UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/9 "2019-05-14T12:09:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![c.hartmann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/c.hartmann/32/247_2.png) [@c.hartmann](https://forum.commonvisionblox.com/u/c.hartmann)\
**Post date:** [May 14, 2019, 12:36pm UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/10 "2019-05-14T12:36:06Z")

</div>

Hi,

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”.

---

<div class="post-metadata">

**Author:** ![lxu](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lxu](https://forum.commonvisionblox.com/u/lxu)\
**Post date:** [May 14, 2019, 1:57pm UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/11 "2019-05-14T13:57:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lxu](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lxu](https://forum.commonvisionblox.com/u/lxu)\
**Post date:** [May 16, 2019, 7:57am UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/12 "2019-05-16T07:57:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![c.hartmann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/c.hartmann/32/247_2.png) [@c.hartmann](https://forum.commonvisionblox.com/u/c.hartmann)\
**Post date:** [May 16, 2019, 8:10am UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/13 "2019-05-16T08:10:31Z")

</div>

Hello,

this is odd, they should have been loadable after cvb installation.  
Yeah, dependency walker always had issues system libs.

---

<div class="post-metadata">

**Author:** ![illusive](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/illusive/32/61_2.png) [@illusive](https://forum.commonvisionblox.com/u/illusive)\
**Post date:** [May 16, 2019, 8:28am UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/14 "2019-05-16T08:28:48Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![keerthitheja](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@keerthitheja](https://forum.commonvisionblox.com/u/keerthitheja)\
**Post date:** [February 17, 2022, 4:04pm UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/16 "2022-02-17T16:04:01Z")

</div>

Hello,  
Any idea how to setup this for Ubuntu 20.04 ?

---

<div class="post-metadata">

**Author:** ![c.hartmann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/c.hartmann/32/247_2.png) [@c.hartmann](https://forum.commonvisionblox.com/u/c.hartmann)\
**Post date:** [February 17, 2022, 4:27pm UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/17 "2022-02-17T16:27:43Z")

</div>

Hi,

I assume you just mean the CVBpy installation.

1. Install CVB (check Download section)
2. Install Python3 and Pip. I.e. “sudo apt install python3 python3-pip”
3. python3 -m pip install /opt/cvb/python/\*.whl

And you are done!

And then you just need an editor (like VS Code).

The whl also installs some examples, so “find /opt/cvb/tutorial | grep -i py” might be a good idea.

---

<div class="post-metadata">

**Author:** ![c.hartmann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/c.hartmann/32/247_2.png) [@c.hartmann](https://forum.commonvisionblox.com/u/c.hartmann)\
**Post date:** [February 17, 2022, 4:28pm UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/18 "2022-02-17T16:28:02Z")

</div>

@keerthitheja

Sorry forgot to tag you.

---

<div class="post-metadata">

**Author:** ![keerthitheja](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@keerthitheja](https://forum.commonvisionblox.com/u/keerthitheja)\
**Post date:** [February 18, 2022, 3:19pm UTC](https://forum.commonvisionblox.com/t/python-setup-guide-with-anaconda-by-christopher/580/19 "2022-02-18T15:19:38Z")

</div>

@c.hartmann  
Thank you so much for the reply. I can now use the CVBpy library 🙂 😃
