Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_ssl and load__ctypes hooks for copying SSL and other DLLs don't work in a pipenv virtualenv #591

Closed
vashek opened this issue Feb 16, 2020 · 10 comments

Comments

@vashek
Copy link

vashek commented Feb 16, 2020

This is like issue #437, except that I'm running setup.py in a virtualenv created by pipenv.
In that case, the SSL DLLs need to be searched in sys.path, not just in sys.base_prefix/"DLLs", because sys.base_prefix is something like C:\Users\USERNAME\.virtualenvs\PROJECTNAME-HASH but there is no DLLs subdirectory there.

Workaround in setup.py:

for dll_mask in ["libcrypto-*.dll", "libssl-*.dll"]:
    for dir_name in sys.path:
        found_dlls = glob.glob(os.path.join(dir_name, dll_mask))
        if found_dlls:
            dataFiles.append(sorted(found_dlls)[-1])
            print(f"... {dataFiles[-1]} found ...")
            break
    else:
        print(f"!!! {dll_mask} not found !!!")
vashek added a commit to vashek/cx_Freeze that referenced this issue Feb 16, 2020
vashek added a commit to vashek/cx_Freeze that referenced this issue Mar 23, 2020
vashek added a commit to vashek/pdl2pdf that referenced this issue Mar 23, 2020
@vashek vashek changed the title load_ssl hook for copying SSL DLLs doesn't work in a pipenv virtualenv load_ssl and load__ctypes hooks for copying SSL and other DLLs don't work in a pipenv virtualenv Mar 23, 2020
@manziEric
Copy link

i have this problem with gcloud that it's not get copy from venv folder in to the new exe it think it is like this problems.
error out put:
File "C:\Users\win10\PycharmProjects\winlog\venv\lib\site-packages\pkg_resources_init_.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'gcloud' distribution was not found and is required by the application

Thanks

@marcelotduarte
Copy link
Owner

@manziEric Your issue is related to #216 and #586

@manziEric
Copy link

@marcelotduarte sorry if its a little bit annoying, but i have not been able to fix the problem with #216 and #586 , i'm not a very experienced python programmer. So i have not been able to solve the problem with the info in #216 and #586 .

@marcelotduarte
Copy link
Owner

@manziEric If my PR #608 is merged, in the next release will fix your issue (instructions to test in #586)

@marcelotduarte
Copy link
Owner

@manziEric
cx_Freeze 6.2 has just been released with namespace detection and initial support for metadata. Please, try it.

@marcelotduarte
Copy link
Owner

@vashek
cx_Freeze 6.2 has just been released. Please inform if you had issues.

@vashek
Copy link
Author

vashek commented Jul 30, 2020

@vashek
cx_Freeze 6.2 has just been released. Please inform if you had issues.

Yes, I still do. With Python 3.8.2 on Windows in a pipenv environment and cx-Freeze 6.2 and Pillow 7.2.0, build fails with:
error: [Errno 2] No such file or directory: 'C:\\Users\\dvorak\\.virtualenvs\\myprogname-yU7Sl9Dj\\DLLs\\libffi-7.dll'

@marcelotduarte
Copy link
Owner

@vashek
If you have a C compiler, you can test the current version:
pip install -U git+https://github.com/marcelotduarte/cx_Freeze.git@master

@marcelotduarte
Copy link
Owner

@vashek I created a Github action to test some samples with pipenv, using the current master.
I run with success.
The tests: https://github.com/marcelotduarte/freeze-test/actions/runs/195629742/workflow
The results: https://github.com/marcelotduarte/freeze-test/runs/947542968

@marcelotduarte
Copy link
Owner

cx_Freeze 6.3 has just been released.
Assuming this has been resolved.
If you had issues please re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants