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 error while running examples #20

Closed
kirle opened this issue Jun 17, 2024 · 1 comment
Closed

Import error while running examples #20

kirle opened this issue Jun 17, 2024 · 1 comment

Comments

@kirle
Copy link
Contributor

kirle commented Jun 17, 2024

I have not found a way to run the examples inside the examples/ folder, as the package is installed in the p2pfl folder inside the root directory, and therefore when trying to run, for example, mnist.py, you get an import error ModuleNotFoundError: No module named 'test.utils.

Perhaps it would be good to add to the documentation more clearly how to run the examples. The easiest way I have found without changing the repository organization is to use python -m examples.mnist.py

@pguijas
Copy link
Collaborator

pguijas commented Jun 22, 2024

Hello @kirle !, putting the examples in src folder might be a good idea, I'll think about it. Also, as for the documentation, we are working on it, to make it as easy as possible for the user (dockers, CLI...).

Finally, the way I have to run the example code is using python3 -m poetry run python examples/mnist.py from the root folder. Did it work for you?

@pguijas pguijas closed this as completed Jun 22, 2024
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

2 participants