# Problems with cvb in pyinstaller

**URL:** <https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203>\
**Category:** Python API\
**Created:** [August 13, 2020, 9:58pm UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203 "2020-08-13T21:58:47Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![stmoe](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@stmoe](https://forum.commonvisionblox.com/u/stmoe)\
**Post date:** [August 13, 2020, 9:58pm UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/1 "2020-08-13T21:58:47Z")

</div>

I try to make a little GUI with pyinstaller. There seems to be a problem with the cvb import:

> (py36) C:\Users\User\qtpy\_test\dist\button5\>button5.exe  
> Traceback (most recent call last):  
> File “button5.py”, line 8, in   
> File “”, line 971, in \_find\_and\_load  
> File “”, line 955, in \_find\_and\_load\_unlocked  
> File “”, line 665, in _load\_unlocked  
> File “c:\users\User\appdata\local\conda\conda\envs\py36\lib\site-packages\PyInstaller\loader\pyimod03\_importers.py”, line 627, in exec\_module  
> exec(bytecode, module. **dict** )  
> File "site-packages\cvb\_init_.py", line 20, in   
> StopIteration

Line 20 in the \_\_init\_\_py says

> site\_packages = next(p for p in \_sys.path if ‘site-packages’ in p)

How can I integrate cvb properly into my GUI?

---

<div class="post-metadata">

**Author:** ![stmoe](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@stmoe](https://forum.commonvisionblox.com/u/stmoe)\
**Post date:** [August 17, 2020, 7:07am UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/2 "2020-08-17T07:07:12Z")

</div>

To clarify, line 8 is the import cvb command and in the .spec file all paths to cvb are set.

---

<div class="post-metadata">

**Author:** ![usernv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/usernv/32/637_2.png) [@usernv](https://forum.commonvisionblox.com/u/usernv)\
**Post date:** [August 17, 2020, 7:29am UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/3 "2020-08-17T07:29:27Z")

</div>

Hi @stmoe,

sorry for the late reply. Did you install the CVB wheel? If not, please run in a command prompt your Python 3.6 pip to install the wheel:  
`python -m pip install %CVB%Lib\Python\cvb-1.1-cp35.cp36.cp37-none-win_amd64.whl`

---

<div class="post-metadata">

**Author:** ![stmoe](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@stmoe](https://forum.commonvisionblox.com/u/stmoe)\
**Post date:** [August 17, 2020, 11:05am UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/4 "2020-08-17T11:05:42Z")

</div>

I am using a windows 10 machine. CVB wheel is installed trough

> cvb-1.0-cp36-cp36m-win\_amd64

But normally I use Python 3.8, only for cvb scripts I use Python 3.6. I got the presumption that there is maybe a problem. Is there no wheel for Python 3.8?

---

<div class="post-metadata">

**Author:** ![s-woe](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/s-woe/32/572_2.png) [@s-woe](https://forum.commonvisionblox.com/u/s-woe)\
**Post date:** [August 17, 2020, 11:29am UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/5 "2020-08-17T11:29:16Z")

</div>

See [here](https://forum.commonvisionblox.com/t/cvb-whl-wheel-file-missing-for-python-3-8/980/6)

---

<div class="post-metadata">

**Author:** ![stmoe](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@stmoe](https://forum.commonvisionblox.com/u/stmoe)\
**Post date:** [August 17, 2020, 11:46am UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/6 "2020-08-17T11:46:56Z")

</div>

This dosen’t work for me. I do the following thing:

1. Install the cvb-1.0-cp36-cp36m-win\_amd64 wheel with python 3.6. (With 3.8 I get an error message)
2. Copy the cvb folder from py36\lib\site-packages to Anaconda3\lib\site-packages
3. replace the _init_ file

But the import in Python 3.8 still fails:

> import cvb  
> Traceback (most recent call last):  
> File “”, line 1, in   
> import cvb  
> File “C:\ProgramData\Anaconda3\Lib\site-packages\cvb\__init_\_.py”, line 32, in   
> import \_cvb  
> ImportError: DLL load failed while importing \_cvb: Das angegebene Modul wurde nicht gefunden.

---

<div class="post-metadata">

**Author:** ![s-woe](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/s-woe/32/572_2.png) [@s-woe](https://forum.commonvisionblox.com/u/s-woe)\
**Post date:** [August 17, 2020, 11:59am UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/7 "2020-08-17T11:59:42Z")

</div>

Hi @stmoe,

you have to execute all the steps in the post. You want cvb to be installed to Python 3.8 , don’t you? Please install the newest :cvb: version.  
Then:

1. rename the wheel in %CVB%\Lib\Python such that Python 3.8s pip check doesn’t reject the installation by adding “cp38” to the wheels file name (i.e. “cvb-1.1-cp35.cp36.cp37.cp38-none-win\_amd64.whl”)
2. install it via python3.8s pip installer via \<yourpathtopython3.8.exe\> -m pip install %CVB%\Lib\Python\cvb-1.1-cp35.cp36.cp37.cp38-none-win\_amd64.whl
3. now replace the init file in **python3.8 site-packages** (find it via \<yourpathtopython3.8.exe\> -c “import site; print(site.getsitepackages())”) with the provided one in the [post](https://forum.commonvisionblox.com/t/cvb-whl-wheel-file-missing-for-python-3-8/980) as described there.

---

<div class="post-metadata">

**Author:** ![stmoe](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@stmoe](https://forum.commonvisionblox.com/u/stmoe)\
**Post date:** [August 17, 2020, 12:18pm UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/8 "2020-08-17T12:18:00Z")

</div>

thanks, now cvb works also in Python 3.8.  
But it seem that was not the issue, the original problem with the failed pyinstaller packeting of cvb persists.

---

<div class="post-metadata">

**Author:** ![s-woe](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/s-woe/32/572_2.png) [@s-woe](https://forum.commonvisionblox.com/u/s-woe)\
**Post date:** [August 17, 2020, 12:22pm UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/9 "2020-08-17T12:22:20Z")

</div>

you may now try to execute the packeting in py3.8

---

<div class="post-metadata">

**Author:** ![stmoe](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@stmoe](https://forum.commonvisionblox.com/u/stmoe)\
**Post date:** [August 17, 2020, 12:41pm UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/10 "2020-08-17T12:41:10Z")

</div>

There is still the same issue from the original post.

---

<div class="post-metadata">

**Author:** ![s-woe](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/s-woe/32/572_2.png) [@s-woe](https://forum.commonvisionblox.com/u/s-woe)\
**Post date:** [August 17, 2020, 1:02pm UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/11 "2020-08-17T13:02:37Z")

</div>

The error says that there is no site-packages in your python search path. I’m afraid this is due to the fact that you’re working on virtual environments with --no-site-packages enabled (are you?) . You may provide a bigger picture of your whole application. Is there anything similar to a site-packages path in the output of python -c “import sys; print(sys.path)” ?

---

<div class="post-metadata">

**Author:** ![stmoe](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@stmoe](https://forum.commonvisionblox.com/u/stmoe)\
**Post date:** [August 17, 2020, 2:54pm UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/12 "2020-08-17T14:54:48Z")

</div>

I am working in the anaconda prompt. The thing is all other imports of my application work fine with pyinstaller.  
If I do python -c “import cvb” cvb works fine.

with python -c “import sys; print(sys.path)” I get:

> [‘’, ‘C:\ProgramData\Anaconda3\python38.zip’, ‘C:\ProgramData\Anaconda3\DLLs’, ‘C:\ProgramData\Anaconda3\lib’, ‘C:\ProgramData\Anaconda3’, ‘C:\ProgramData\Anaconda3\lib\site-packages’, **‘C:\ProgramData\Anaconda3\lib\site-packages\cvb’** , ‘C:\ProgramData\Anaconda3\lib\site-packages\win32’, ‘C:\ProgramData\Anaconda3\lib\site-packages\win32\lib’, ‘C:\ProgramData\Anaconda3\lib\site-packages\Pythonwin’]

This seems to work properly

---

<div class="post-metadata">

**Author:** ![s-woe](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/s-woe/32/572_2.png) [@s-woe](https://forum.commonvisionblox.com/u/s-woe)\
**Post date:** [August 18, 2020, 6:58am UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/13 "2020-08-18T06:58:48Z")

</div>

A problem we already faced with pyinstaller is, that it searches for dlls in the directory, where the pyinstaller package is built. So you may try to place CVB dlls directly in the package. [You may also have a look at this.](https://forum.commonvisionblox.com/t/cvbpy-with-pyinstaller/1079)

---

<div class="post-metadata">

**Author:** ![stmoe](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@stmoe](https://forum.commonvisionblox.com/u/stmoe)\
**Post date:** [August 24, 2020, 7:44am UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/14 "2020-08-24T07:44:24Z")

</div>

I tried the suggested manual copying of the files with no success.

---

<div class="post-metadata">

**Author:** ![s-woe](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/s-woe/32/572_2.png) [@s-woe](https://forum.commonvisionblox.com/u/s-woe)\
**Post date:** [September 2, 2020, 11:25am UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/15 "2020-09-02T11:25:09Z")

</div>

This might be a stupid question, but what exaclty is now your error ? as you said, “there is still the same issue from the original post” - which is - please tell me if i’m wrong - that the site-packages are not found.

---

<div class="post-metadata">

**Author:** ![stmoe](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@stmoe](https://forum.commonvisionblox.com/u/stmoe)\
**Post date:** [September 4, 2020, 6:06am UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/16 "2020-09-04T06:06:11Z")

</div>

Yea this is right. “Import cvb” causes the error in the original post.

---

<div class="post-metadata">

**Author:** ![s-woe](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/s-woe/32/572_2.png) [@s-woe](https://forum.commonvisionblox.com/u/s-woe)\
**Post date:** [September 4, 2020, 6:48am UTC](https://forum.commonvisionblox.com/t/problems-with-cvb-in-pyinstaller/1203/17 "2020-09-04T06:48:00Z")

</div>

Okay, this doesn’t help.

In order to speed this up, I have two suggestions: Either you try the steps I described before, or you make an official request to [de.support@stemmer-imaging.com](mailto:de.support@stemmer-imaging.com) and describe your specific situation. I hope we will solve this soon!
