bjorns / mock-idp

A minimal identity provider for testing auth integrations
MIT License
38 stars 18 forks source link

ModuleNotFoundError: No module named 'mockidp.saml #4

Open Adsidera opened 3 years ago

Adsidera commented 3 years ago

I have proceeded in installing mock-idp in Ubuntu 20.4, following the instructions in the README. When I run it, I get the error No module named 'mockidp.saml . I haven't touched any configuration files. Are there any steps I am missing?

achimmihca commented 3 years ago

I also encountered this. To fix it, I moved the file in bin-folder (a python file with missing extension) one level up, so the import-statement is finding the mockidp folder.

What I did:

This is for basic setup. Now it should be possible to run the code.

The module mockidp refers to the folder with the same name. It can be imported from a python file, but not from bin-folder. Thus, I moved the file in bin folder to the project root (and renamed it to "run-mock-idp.py")

So you have: ~/mockidp (folder) ~/run-mock-idp.py

Content of run-mock-idp.py is this: https://github.com/bjorns/mock-idp/blob/master/bin/mock-idp It just calls the main function from mockidp/main.py

This way, I am able to run it via python run-mock-idp.py

achimmihca commented 3 years ago

You may want to try my fork of this repo: link.

There, the run-mock-idp.py file is already in the correct place. I also added a vscode launch configuration there.

bjorns commented 3 years ago

Hi @Adsidera

What version of python are you running? And can you also list the specific commands you are running?

I was not able to reproduce your problem but I'll admit the README could use some work.