Donders-Institute / bidscoin

BIDScoin converts your source-level neuroimaging data to BIDS
https://bidscoin.readthedocs.io
GNU General Public License v3.0
129 stars 35 forks source link

ruamel and bids editor modules don't get installed properly #79

Closed thomasbeaudry closed 3 years ago

thomasbeaudry commented 3 years ago

Hi, i installed the latest version of bidscoins via the instructions on read the docs;

$ pip install --upgrade git+https://github.com/Donders-Institute/bidscoin

:Afterwards, I try to run the bidsmapper command and I get the following error:

~$ bidsmapper -n CIRM_ ~/Documents/CIRM/Source/MRI/ ~/Documents/CIRM/Source/MRI/BIDS/ Traceback (most recent call last): File "/data/util/Anaconda/2020-11_using_python3.8.5/lib/python3.8/site-packages/bidscoin/bidsmapper.py", line 24, in from bidscoin import bidscoin, bids, bidseditor File "/data/util/Anaconda/2020-11_using_python3.8.5/lib/python3.8/site-packages/bidscoin/bids.py", line 25, in from ruamel.yaml import YAML ModuleNotFoundError: No module named 'ruamel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/data/util/Anaconda/2020-11_using_python3.8.5/bin/bidsmapper", line 5, in from bidscoin.bidsmapper import main File "/data/util/Anaconda/2020-11_using_python3.8.5/lib/python3.8/site-packages/bidscoin/bidsmapper.py", line 26, in import bidscoin, bids, bidseditor # This should work if bidscoin was not pip-installed ModuleNotFoundError: No module named 'bidseditor'

marcelzwiers commented 3 years ago

Mhhh strange, the pip install was without errors? Did you install bidscoin using a conda environment?

thomasbeaudry commented 3 years ago

@marcelzwiers Yes the pip install was without errors - note that i tried pip install bidscoin first, and then i did the install i mentioned above secondly, which uninstalled the first install and redid the second one, but with zero errors reported.

I'm using and Anaconda (2020-11) with python3.8.5 environment

marcelzwiers commented 3 years ago

Still, the installed packages are somehow not on your pythonpath so I suspect there must have been a warning or error somewhere, or that your conda environment was not activated correctly? This is a bit difficult for me to fix, because it's not a bidscoin issue

marcelzwiers commented 3 years ago

Can or did you do something like this?

conda create -name bidscoin
conda activate bidscoin
pip install bidscoin
bidsmapper -h
marcelzwiers commented 3 years ago

I myself sometimes have troubles with my .local/ directory, where old / corrupt copies of libraries can exist. Sometimes conda clean --all can help (or even manually deleting .local/lib/python3.8/site-packages/[somepackages])

thomasbeaudry commented 3 years ago

Hi @marcelzwiers thanks for the reply. I'm trying your instructions on a fresh install of Anaconda 2021.05

$ conda create -name bidscoin Collecting package metadata (current_repodata.json): done Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

Current channels:

What is the channel that contains bidscoin? Maybe you meant for me to specify the prefix instead of the name and just create a custom name for my envirnoment? Thanks

that being said, my end goal is to have bidscoin running as a Ubuntu Environment module since it will be shared on my cluster, so I'd like an install that works without creating a custom conda envirnoment and instead just be able to add the anaconda bin folder to my path like i do for other python packages. I tried doing a regular pip intall bidscoin on this new fresh install, i get this error:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. spyder 4.2.5 requires pyqtwebengine<5.13, which is not installed. spyder 4.2.5 requires pyqt5<5.13, but you have pyqt5 5.15.4 which is incompatible.

Thanks so much for your help!

marcelzwiers commented 3 years ago

Sorry, I typed from the top of my head and missed a -, it should have been:

conda create --name bidscoin
[..]
marcelzwiers commented 3 years ago

I don't know about Ubuntu, but bidscoin isn't any different from other python packages. Would you be ok with a virtualenv instead of a conda environment? You would still need to activate that, but otherwise you could try solving your pyqt5 conflict by doing pip install --upgrade PyQt5==5.12 before you do pip install bidscoin

marcelzwiers commented 3 years ago

Python applications are generally installed in a virtual environment, but unfortunately this doesn't go well the module system. On our cluster, I installed the conda environment on our shared /opt network drive like this (more or less):

conda create --prefix=/opt/bidscoin
source activate /opt/bidscoin
pip install bidscoin

Then other users need to do:

module load bidscoin
source activate /opt/bidscoin

The module system can't activate python environments and to inform the users about the extra step I added this line to the bidscoin module:

puts stderr "You can now run bidscoin/$version functions if you activate this bidscoin-environment with:\n\n    source activate /opt/bidscoin\n\nFor more information see:\n\n    module help bidscoin\n"
marcelzwiers commented 3 years ago

@thomasbeaudry Is it working for you now? I am about to release a minor bugfix upgrade (v3.6.3), but maybe I can address your issue before doing that?

Michael-Monaldi commented 3 years ago

Also using conda environments. $ pip install --upgrade git+https://github.com/Donders-Institute/bidscoin no longer works also, downloading master, unzipping, and running $ pip install --upgrade ./bidscoin no longer works.

However, I made the following changes to "pyproject.toml" and now the latter method works

[metadata] name = 'bidscoin' version = '3.7.0-dev' description = 'Map source-level neuroimaging data onto a BIDS data structure' author = 'Marcel Zwiers' author_email = 'm.zwiers@donders.ru.nl' license = 'GPL3' url = 'https://github.com/Donders-Institute/bidscoin'

[requires] python_version = ['3.8', '3.9']

[options.extras_require] bioread = { version = "^1.0.5"} pymatreader = { version = "^0.0.24"} duecredit = {version = "^0.9.1"} phys2bids = {version = "^2.0.0"}

[build-system] requires = ['setuptools', 'wheel']