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

import gssapi fails on Win 10 #188

Closed
kamikaze opened this issue Dec 3, 2019 · 7 comments
Closed

import gssapi fails on Win 10 #188

kamikaze opened this issue Dec 3, 2019 · 7 comments

Comments

@kamikaze
Copy link

kamikaze commented Dec 3, 2019

import gssapi

Fails with:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\gssapi\__init__.py", line 29, in <module>
    from gssapi.raw.types import NameType, RequirementFlag, AddressType  # noqa
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\gssapi\raw\__init__.py", line 50, in <module>
    from gssapi.raw.creds import *  # noqa
ImportError: DLL load failed: The specified module could not be found.

I'm using Anaconda if it matters

@kamikaze kamikaze changed the title import gssapi fails import gssapi fails on Win 10 Dec 3, 2019
@kamikaze
Copy link
Author

kamikaze commented Dec 4, 2019

both anaconda and simple Python venv fails. I have installed Microsoft Visual C++ Build Tools and MIT Kerberos for windows. No luck, same issue.

@frozencemetery
Copy link
Member

Can you show the full log from the python venv? Create a clean venv, then do pip install gssapi

@kamikaze
Copy link
Author

kamikaze commented Dec 6, 2019

>conda create --name py37 python=3.7
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\kamikaze\envs\py37

  added / updated specs:
    - python=3.7


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    python-3.7.5               |       h8c8aaf0_0        18.6 MB  anaconda
    ------------------------------------------------------------
                                           Total:        18.6 MB

The following NEW packages will be INSTALLED:

  ca-certificates    anaconda/win-64::ca-certificates-2019.11.27-0
  certifi            anaconda/win-64::certifi-2019.11.28-py37_0
  openssl            anaconda/win-64::openssl-1.1.1d-he774522_3
  pip                anaconda/win-64::pip-19.3.1-py37_0
  python             anaconda/win-64::python-3.7.5-h8c8aaf0_0
  setuptools         anaconda/win-64::setuptools-42.0.2-py37_0
  sqlite             anaconda/win-64::sqlite-3.30.1-he774522_0
  vc                 anaconda/win-64::vc-14.1-h0510ff6_4
  vs2015_runtime     anaconda/win-64::vs2015_runtime-14.16.27012-hf0eaf9b_0
  wheel              anaconda/win-64::wheel-0.33.6-py37_0
  wincertstore       anaconda/win-64::wincertstore-0.2-py37_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
python-3.7.5         | 18.6 MB   | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate py37
#
# To deactivate an active environment, use
#
#     $ conda deactivate


(base) C:\Users\kamikaze>conda activate py37

(py37) C:\Users\kamikaze>python -m pip install -U gssapi
Collecting gssapi
  Downloading https://files.pythonhosted.org/packages/99/f0/0858b4eca070da0e4735f883e55a5f13f192713eba01e54e30979b5a33bf/gssapi-1.6.1-cp37-cp37m-win_amd64.whl (684kB)
     |████████████████████████████████| 686kB 6.4MB/s
Collecting six>=1.4.0
  Downloading https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Collecting decorator
  Using cached https://files.pythonhosted.org/packages/8f/b7/f329cfdc75f3d28d12c65980e4469e2fa373f1953f5df6e370e84ea2e875/decorator-4.4.1-py2.py3-none-any.whl
Installing collected packages: six, decorator, gssapi
Successfully installed decorator-4.4.1 gssapi-1.6.1 six-1.13.0

(py37) C:\Users\kamikaze>python
Python 3.7.5 (default, Oct 31 2019, 15:18:51) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import gssapi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\kamikaze\envs\py37\lib\site-packages\gssapi\__init__.py", line 29, in <module>
    from gssapi.raw.types import NameType, RequirementFlag, AddressType  # noqa
  File "C:\Users\kamikaze\envs\py37\lib\site-packages\gssapi\raw\__init__.py", line 50, in <module>
    from gssapi.raw.creds import *  # noqa
ImportError: DLL load failed: The specified module could not be found.
>>>

@kamikaze
Copy link
Author

kamikaze commented Dec 6, 2019

update: if I will install MIT Kerberos - I get a login/password form which is strange. Is there any way to make it working like Chrome which is able to authenticate seamlessly when accessing same resources?

we use SPNEGO

@simo5
Copy link
Contributor

simo5 commented Dec 6, 2019

You need to use the native SSPI to be able to use the interal windows credential cache I believe.
Although trying with the MSLSA: cache type may work too.

@kamikaze
Copy link
Author

kamikaze commented Dec 6, 2019

native SSPI
MSLSA

any example? Thanks

@frozencemetery
Copy link
Member

I don't think we have one, sorry. (I only work on Linux.)

I would recommend you start here https://github.com/krb5/krb5/blob/master/src/windows/README#L162

Use of MSLSA isn't specific to python-gssapi though; I'd recommend reaching out to krb5 channels if you get stuck.

Closing since the original issue is resolved by installing krb5.

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