Problems with cvb in pyinstaller

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?

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

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

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?

See here

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.

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 as described there.

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.

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

There is still the same issue from the original post.

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)” ?

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

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.

1 Like

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

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.

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

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 and describe your specific situation. I hope we will solve this soon!