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

No module named 'pytest' while executing bidsmapper #193

Closed
mateuszpawlik opened this issue Jul 27, 2023 · 6 comments
Closed

No module named 'pytest' while executing bidsmapper #193

mateuszpawlik opened this issue Jul 27, 2023 · 6 comments

Comments

@mateuszpawlik
Copy link

mateuszpawlik commented Jul 27, 2023

Describe the bug
When executing bidsmapper I get No module named 'pytest' error. I see pytest in the optional dependencies.

To reproduce
Steps to reproduce the behavior:

  1. Execute bidsmapper
  2. See error in the bidsmapper.log:
    ERROR | Could not import /root/.local/pipx/venvs/bidscoin/lib/python3.11/site-packages/bidscoin/plugins/dcm2niix2bids.py: No module named 'pytest'
    

Expected behavior
I guess pytest should be installed as a dependency and the error shouldn't then happen.

Software version

  • BIDScoin version: development 2899e04
  • installed with pipx install git+https://github.com/Donders-Institute/bidscoin.git@2899e04
  • OS: Debian 12 in Docker on Debian 11
@mateuszpawlik
Copy link
Author

Maybe pipx causes troubles.

@marcelzwiers
Copy link
Collaborator

marcelzwiers commented Jul 28, 2023 via email

@mateuszpawlik
Copy link
Author

I used pipx to install BIDScoin in a Docker container. This is a recommended way to install Python applications by, for example, Debian 12. pipx creates a virtual environment in which it installs the application and all its Python dependencies. My guess is, pipx didn't know about the pytest dependency.

pipx kindly allows to install manually (pipx inject command) a missing module. Executing pipx inject bidscoin pytest solved the problem for me.

@marcelzwiers
Copy link
Collaborator

marcelzwiers commented Aug 14, 2023

Mhhh, pytest is no longer used in bidscoin, but only when running bidscoin tests:

https://github.com/search?q=repo%3ADonders-Institute%2Fbidscoin%20%22import%20pytest%22&type=code

But this line in the dcm2niix2bids plugin has a pytest dependency, for which I now added a work-around (e558982). Does this solve your error?

@mateuszpawlik
Copy link
Author

It seems to be fine now. I installed BIDScoin with pipx install git+https://github.com/Donders-Institute/bidscoin.git@e558982 and executed it. There were no complaints on pytest missing.

@mateuszpawlik
Copy link
Author

Btw. pipx allows for a very quick installation and testing :-)

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