Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

pychef cannot find libeay32.dll on Windows #56

Open
gliptak opened this issue May 2, 2016 · 13 comments
Open

pychef cannot find libeay32.dll on Windows #56

gliptak opened this issue May 2, 2016 · 13 comments

Comments

@gliptak
Copy link
Contributor

gliptak commented May 2, 2016

This is installing into a "standalone" Python install (as contrasted with Cygwin).

>scripts\pip install pychef
...
>python -m chef
Traceback (most recent call last):
  File "C:\Python35\lib\runpy.py", line 151, in _run_module_as_main

    mod_name, mod_spec, code = _get_module_details(mod_name)
  File "C:\Python35\lib\runpy.py", line 118, in _get_module_details

    return _get_module_details(pkg_main_name)
  File "C:\Python35\lib\runpy.py", line 104, in _get_module_details

    spec = importlib.util.find_spec(mod_name)
  File "C:\Python35\lib\importlib\util.py", line 88, in find_spec
    parent = __import__(parent_name, fromlist=['__path__'])
  File "C:\Python35\lib\site-packages\chef\__init__.py", line 5, in
 <module>
    from chef.api import ChefAPI, autoconfigure
  File "C:\Python35\lib\site-packages\chef\api.py", line 17, in <mo
dule>
    from chef.rsa import Key
  File "C:\Python35\lib\site-packages\chef\rsa.py", line 6, in <mod
ule>
    _eay = CDLL('libeay32.dll')
  File "C:\Python35\lib\ctypes\__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
@gliptak
Copy link
Contributor Author

gliptak commented May 2, 2016

The workaround is to copy Git\mingw64\bin\libeay32.dll into %PYTHON_HOME%

@coderanger
Copy link
Owner

Or add that folder to your PATH so it can find the DLL. What variant of OpenSSL does the 3.5 for Windows installer use?

@coderanger
Copy link
Owner

Oh, it might be libeay64.dll now that we have 64-bit on Windows working correctly.

@gliptak
Copy link
Contributor Author

gliptak commented May 2, 2016

I couldn't find a good OpenSSL installer to download ... And yes, Git runs https/ssh protocols using the libeay64.dll. I will continue to exercise this tomorrow.
Would you consider updating the install to deliver libeay64.dll for Windows installs?
Thanks

@coderanger
Copy link
Owner

Python includes OpenSSL already as part of its TLS support. I don't have a Windows machine handy to look at which DLLs it specifically has for 3.5 though, so you need to do that (or someone else).

@coderanger
Copy link
Owner

And no, I can't redistribute an OpenSSL Windows binary inside a pure-Python package, I think @dstufft's raw horror might kill me on the spot.

@gliptak
Copy link
Contributor Author

gliptak commented May 2, 2016

That wouldn't work well :)

The Windows files are at:

https://www.python.org/ftp/python/3.5.1/python-3.5.1-embed-win32.zip

It is not clear to me which one contains OpenSSL ...

@gliptak
Copy link
Contributor Author

gliptak commented May 3, 2016

Now I'm seeing InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning)
I tried to override (for now) by setting api.ssl_verify = False, but it didn't take effect ...

@gliptak
Copy link
Contributor Author

gliptak commented May 11, 2016

#49

@coderanger
Copy link
Owner

I looked in to this a bit last weekend. Apparently I just hallucinated that Python distributes libeay32.dll because as far as I could find, they never did.

@fredrikslattman
Copy link

Does this mean that pychef is not supported on Windows? I've tried to copy the libeay32.dll from git/mingw64/ but that doesn't solve the issue.

Is this project abandoned?

@Tech356
Copy link

Tech356 commented Jan 4, 2017

To get pychef to work on Windows for me, I downloaded the SSL libraries from http://indy.fulgan.com/SSL/ and put them into the system32 directory.

@h4ckninja
Copy link

Seeing this on Windows 10 and Python 3.8:

Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import chef
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Micheal\Projects\Tools\Public\Python\chef-pillage\venv\lib\site-packages\chef\__init__.py", line 5, in <module>
    from chef.api import ChefAPI, autoconfigure
  File "C:\Users\Micheal\Projects\Tools\Public\Python\chef-pillage\venv\lib\site-packages\chef\api.py", line 17, in <module>
    from chef.rsa import Key
  File "C:\Users\Micheal\Projects\Tools\Public\Python\chef-pillage\venv\lib\site-packages\chef\rsa.py", line 6, in <module>
    _eay = CDLL('libeay32.dll')
  File "C:\Users\Micheal\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'libeay32.dll'. Try using the full path with constructor syntax.

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

No branches or pull requests

5 participants