minrk / pamela

Python PAM interface
Other
34 stars 10 forks source link

Pamela doesn't run in conda virtual environment #12

Closed ArneBachmann closed 6 years ago

ArneBachmann commented 6 years ago
(jupyterhub) C:\Users\bach_ar>python -m pamela -a bach_ar
Traceback (most recent call last):
  File "d:\apps\Miniconda3\envs\jupyterhub\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\apps\Miniconda3\envs\jupyterhub\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "d:\apps\Miniconda3\envs\jupyterhub\lib\site-packages\pamela.py", line 49, in <module>
    LIBPAM = CDLL(find_library("pam"))
  File "d:\apps\Miniconda3\envs\jupyterhub\lib\ctypes\__init__.py", line 351, in __init__
    self._handle = _dlopen(self._name, mode)
TypeError: LoadLibrary() argument 1 must be str, not None

Could it be that the DLL is somehow hardcoded and not found if pamela installed into the environment?

minrk commented 6 years ago

C:\Users\bach_ar>

This is probably the key. pamela is a wrapper for PAM, which doesn't exist on Windows.

ArneBachmann commented 6 years ago

Yeah, that's what I gathered when I checked available conda builds for pamela, none of which were Windows targets. I found out how to disable pamela in the project jupyterhub (which is configured to use pamela authentication as the default, but doesn't install that dependency automatically).

minrk commented 6 years ago

Indeed! pamela was written for jupyterhub, which also doesn't officially support Windows, but it can be used on Windows if you use a custom Authenticator and Spawner.