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

KeyError: 'OPENSSL_CONF #15

Open
yjz1234 opened this issue Jan 9, 2020 · 5 comments
Open

KeyError: 'OPENSSL_CONF #15

yjz1234 opened this issue Jan 9, 2020 · 5 comments

Comments

@yjz1234
Copy link

yjz1234 commented Jan 9, 2020

When I am installing in my pc with win 10 ,it's error :
` Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
yield saved
File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
yield
File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 45, in execfile
exec(code, globals, locals)
File "C:\Users\12711\AppData\Local\Temp\easy_install-lzkw1izd\petlib-0.0.45\setup.py", line 40, in
],
File "d:\python3\lib\site-packages\setuptools_init
.py", line 143, in setup
return distutils.core.setup(**attrs)
File "d:\python3\lib\distutils\core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "d:\python3\lib\site-packages\setuptools\dist.py", line 442, in init
k: v for k, v in attrs.items()
File "d:\python3\lib\distutils\dist.py", line 281, in init
self.finalize_options()
File "d:\python3\lib\site-packages\setuptools\dist.py", line 601, in finalize_options
ep.load()(self, ep.name, value)
File "d:\python3\lib\site-packages\cffi\setuptools_ext.py", line 217, in cffi_modules
add_cffi_module(dist, cffi_module)
File "d:\python3\lib\site-packages\cffi\setuptools_ext.py", line 49, in add_cffi_module
execfile(build_file_name, mod_vars)
File "d:\python3\lib\site-packages\cffi\setuptools_ext.py", line 25, in execfile
exec(code, glob, glob)
File "petlib/compile.py", line 34, in
File "d:\python3\lib\os.py", line 669, in getitem
raise KeyError(key) from None
KeyError: 'OPENSSL_CONF'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\12711\AppData\Local\Temp\pip-install-575rjrxd\bplib\setup.py", line 41, in <module>
    zip_safe=False,
  File "d:\python3\lib\site-packages\setuptools\__init__.py", line 142, in setup
    _install_setup_requires(attrs)
  File "d:\python3\lib\site-packages\setuptools\__init__.py", line 137, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "d:\python3\lib\site-packages\setuptools\dist.py", line 586, in fetch_build_eggs
    replace_conflicting=True,
  File "d:\python3\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
    replace_conflicting=replace_conflicting
  File "d:\python3\lib\site-packages\pkg_resources\__init__.py", line 1063, in best_match
    return self.obtain(req, installer)
  File "d:\python3\lib\site-packages\pkg_resources\__init__.py", line 1075, in obtain
    return installer(requirement)
  File "d:\python3\lib\site-packages\setuptools\dist.py", line 653, in fetch_build_egg
    return cmd.easy_install(req)
  File "d:\python3\lib\site-packages\setuptools\command\easy_install.py", line 679, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "d:\python3\lib\site-packages\setuptools\command\easy_install.py", line 705, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "d:\python3\lib\site-packages\setuptools\command\easy_install.py", line 890, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "d:\python3\lib\site-packages\setuptools\command\easy_install.py", line 1158, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "d:\python3\lib\site-packages\setuptools\command\easy_install.py", line 1144, in run_setup
    run_setup(setup_script, args)
  File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 253, in run_setup
    raise
  File "d:\python3\lib\contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "d:\python3\lib\contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "d:\python3\lib\site-packages\setuptools\_vendor\six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
    yield saved
  File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "d:\python3\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "C:\Users\12711\AppData\Local\Temp\easy_install-lzkw1izd\petlib-0.0.45\setup.py", line 40, in <module>
    ],
  File "d:\python3\lib\site-packages\setuptools\__init__.py", line 143, in setup
    return distutils.core.setup(**attrs)
  File "d:\python3\lib\distutils\core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "d:\python3\lib\site-packages\setuptools\dist.py", line 442, in __init__
    k: v for k, v in attrs.items()
  File "d:\python3\lib\distutils\dist.py", line 281, in __init__
    self.finalize_options()
  File "d:\python3\lib\site-packages\setuptools\dist.py", line 601, in finalize_options
    ep.load()(self, ep.name, value)
  File "d:\python3\lib\site-packages\cffi\setuptools_ext.py", line 217, in cffi_modules
    add_cffi_module(dist, cffi_module)
  File "d:\python3\lib\site-packages\cffi\setuptools_ext.py", line 49, in add_cffi_module
    execfile(build_file_name, mod_vars)
  File "d:\python3\lib\site-packages\cffi\setuptools_ext.py", line 25, in execfile
    exec(code, glob, glob)
  File "petlib/compile.py", line 34, in <module>
  File "d:\python3\lib\os.py", line 669, in __getitem__
    raise KeyError(key) from None
KeyError: 'OPENSSL_CONF'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\Users\12711\AppData\Local\Temp\pip-install-575rjrxd\bplib`

@rareguy
Copy link

rareguy commented Feb 6, 2020

Same issue here! First time installing this it stopped on petlib. Second try and so on, it has the same error as yours. Then I thought maybe petlib is the culprit. And I tried to install petlib alone, and I got OPENSSL_CONF error too! Maybe this might lead to something?

@yjz1234
Copy link
Author

yjz1234 commented Feb 6, 2020

Yes,that's because openssl is incompatible with petlib. There is issue :gdanezis/petlib#23.

@rareguy
Copy link

rareguy commented Feb 7, 2020

It is still trying to use petlib, whether it's from PyPI or directly cloning this repository. Are there still files that use it?
I got this error:

Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "C:\Users\Rifqi\AppData\Local\Temp\pip-wheel-oq054npq\petlib\setup.py", line 40, in <module>
            zip_safe=False,
          File "e:\computer language\python 3.7.2\lib\site-packages\setuptools\__init__.py", line 145, in setup
            return distutils.core.setup(**attrs)
          File "e:\computer language\python 3.7.2\lib\distutils\core.py", line 108, in setup
            _setup_distribution = dist = klass(attrs)
          File "e:\computer language\python 3.7.2\lib\site-packages\setuptools\dist.py", line 448, in __init__
            k: v for k, v in attrs.items()
          File "e:\computer language\python 3.7.2\lib\distutils\dist.py", line 292, in __init__
            self.finalize_options()
          File "e:\computer language\python 3.7.2\lib\site-packages\setuptools\dist.py", line 740, in finalize_options
            ep.load()(self)
          File "e:\computer language\python 3.7.2\lib\site-packages\setuptools\dist.py", line 747, in _finalize_setup_keywords
            ep.load()(self, ep.name, value)
          File "e:\computer language\python 3.7.2\lib\site-packages\cffi\setuptools_ext.py", line 217, in cffi_modules
            add_cffi_module(dist, cffi_module)
          File "e:\computer language\python 3.7.2\lib\site-packages\cffi\setuptools_ext.py", line 49, in add_cffi_module
            execfile(build_file_name, mod_vars)
          File "e:\computer language\python 3.7.2\lib\site-packages\cffi\setuptools_ext.py", line 25, in execfile
            exec(code, glob, glob)
          File "petlib/compile.py", line 34, in <module>
            openssl_conf = os.environ["OPENSSL_CONF"]
          File "e:\computer language\python 3.7.2\lib\os.py", line 678, in __getitem__
            raise KeyError(key) from None
        KeyError: 'OPENSSL_CONF'

Near the end there is a "petlib" used.

@yjz1234
Copy link
Author

yjz1234 commented Feb 7, 2020

That's a bug on windows's openssl, you can look it in gdanezis/petlib#23

@AlexKudzin
Copy link

Can someone re-do & update the install guide?
Which OpenSSL binary edition v?
From where as the link is dead?
Where should it be placed, which directory?
After executing the command vcvars32.bat or vcvarsx86_amd64.bat, the path should be correctly configured by?
Is the dependency crypto, pip crypto? pip pycrypto? a library in OpenSSL?

I have tried following the guide,

On Windows, install 32 bit or 64 bit OpenSSL binary edition matching your Python installation. (64 bit)
Ensure libeay32.dll is on the system PATH (https://www.openssl.org/related/binaries.html). THIS LINK NO LONGER WORKS
Configure the path variables of Microsoft VS compilers for 32 bit or 64 bit architectures, by executing the command vcvars32.bat or vcvarsx86_amd64.bat.

I found the binaries here, https://wiki.openssl.org/index.php/Binaries
First I placed them separately in OS
Then ran the vcvarsx86_amd64.bat and set the PATH, when this didn't work
I tried placing them in python, pip, OpenSSL... and setting the path both via vcvarsx86_amd64.bat & environments.

However every time I run pip install petlib it fails with
_DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try pip install --use-pep517.
OSError: ctypes.util.find_library() did not manage to locate a library called 'crypto'

However, pip install --use-pep517 petlib, also fails!
Collecting petlib
Using cached petlib-0.0.45.tar.gz (245 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [50 lines of output]
Traceback (most recent call last):
File "C:\Users\k_alex\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "C:\Users\k_alex\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k_alex\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 149, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\overlay\Lib\site-packages\setuptools\build_meta.py", line 396, in prepare_metadata_for_build_wheel
self.run_setup()
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup
super(BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
exec(code, locals())
File "", line 7, in
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\overlay\Lib\site-packages\setuptools_init
.py", line 107, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\overlay\Lib\site-packages\setuptools_distutils\core.py", line 147, in setup
_setup_distribution = dist = klass(attrs)
^^^^^^^^^^^^
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\overlay\Lib\site-packages\setuptools\dist.py", line 485, in init
_Distribution.init(
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 283, in init
self.finalize_options()
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\overlay\Lib\site-packages\setuptools\dist.py", line 926, in finalize_options
ep(self)
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\overlay\Lib\site-packages\setuptools\dist.py", line 946, in _finalize_setup_keywords
ep.load()(self, ep.name, value)
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\normal\Lib\site-packages\cffi\setuptools_ext.py", line 219, in cffi_modules
add_cffi_module(dist, cffi_module)
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\normal\Lib\site-packages\cffi\setuptools_ext.py", line 49, in add_cffi_module
execfile(build_file_name, mod_vars)
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\normal\Lib\site-packages\cffi\setuptools_ext.py", line 25, in execfile
exec(code, glob, glob)
File "petlib/compile.py", line 76, in
openssl_version_code = get_openssl_version(warn=True) # pylint: disable=undefined-variable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 22, in get_openssl_version
File "", line 14, in get_abi_lib
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\normal\Lib\site-packages\cffi\api.py", line 150, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\normal\Lib\site-packages\cffi\api.py", line 832, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\k_alex\AppData\Local\Temp\pip-build-env-w7t5r3me\normal\Lib\site-packages\cffi\api.py", line 827, in _load_backend_lib
raise OSError(msg)
OSError: ctypes.util.find_library() did not manage to locate a library called 'crypto'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

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