Failed to install NiBetaSeries

Hi I tried to install the package, but the instalation fails at matplotlib. Does any one experience this and how I should solve this issue? I have installed this via pip or conda, and two different computers, same issues exist.

Can you paste the error output?

Hi Steven thank you so much for your help during this holiday season… here is what I ran "python -m pip install “nibetaseries==0.6.0"”, in order to install within the anaconda environment

and here is the error message:
WARNING: Discarding https://files.pythonhosted.org/packages/1e/20/2032ad99f0dfe0f60970941af36e8d0942d3713f442bb3df37ac35d67358/matplotlib-2.2.4.tar.gz#sha256=029620799e581802961ac1dcff5cb5d3ee2f602e0db9c0f202a90495b37d2126 (from Links for matplotlib). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

ERROR: Could not find a version that satisfies the requirement matplotlib~=2.2.4 (from nibetaseries) (from versions: 0.86, 0.86.1, 0.86.2, 0.91.0, 0.91.1, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1rc1, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 2.0.0b1, 2.0.0b2, 2.0.0b3, 2.0.0b4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2, 2.2.0rc1, 2.2.0, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 3.0.0rc2, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0rc1, 3.1.0rc2, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0rc1, 3.2.0rc3, 3.2.0, 3.2.1, 3.2.2, 3.3.0rc1, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.4.0rc1, 3.4.0rc2, 3.4.0rc3, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.5.0b1, 3.5.0rc1, 3.5.0, 3.5.1)

ERROR: No matching distribution found for matplotlib~=2.2.4

Can you try installing matplotlib before installing nibetaseries, not specifying the nibetaseries version in the pip command, and including a -U pip argument?

Hi the matplotlib had been installed and the version is 3.4.3 based on the list. Can you tell me a little bit more about the -U pip argument? I tried but it says " -U: command not found“. I would appreciate it if you could be more specific, I am new to python

-U is synonymous with --upgrade, and will make sure everything is up to date. So try python -m pip install --upgrade nibetaseries. If this fails, perhaps you should just turn to Docker/Singularity (depending on your operating system) and use the precompiled v0.6.0 container (Docker Hub)

Hi Steven, thank you so much for your help! So I installed docker and then run the command on terminal “docker pull hbclab/nibetaseries:v0.6.0” - seems like it has been successfully installed. This is what it gave me:

iMac:~ jd$ docker pull hbclab/nibetaseries:v0.6.0

v0.6.0: Pulling from hbclab/nibetaseries

56da78ce36e9: Pull complete

8c607105f84a: Pull complete

9f1697c8a0c4: Pull complete

d0c9a22af274: Pull complete

87e4cf59e9af: Pull complete

c8ed569180fd: Pull complete

dc14d12b45f9: Pull complete

5ce32a3b4420: Pull complete

bf3a1f27d118: Pull complete

3e0e619691e3: Pull complete

6975438fe54d: Pull complete

b999784ef6d8: Pull complete

66ca686ee34c: Pull complete

fb71a89db323: Pull complete

9a0a497262b5: Pull complete

7833eeb91f60: Pull complete

Digest: sha256:3ad2d31ae5a8cac2c1f98f064fd6df16f71cadd3f12de6e1b2035bd6c606b508

Status: Downloaded newer image for hbclab/nibetaseries:v0.6.0

docker.io/hbclab/nibetaseries:v0.6.0

So it should be ok to use NibetaSeries from now on? I use “conda list” and “pip list” to check the module and there is nothing like nibetaseries there.

See the Docker example here for how to run it: Installation — NiBetaSeries 0.6.0 documentation

Yes, this is what I followed to install. I am curious should I run this on python script or docker? “docker run -it --rm -v /path/to/bids_dir:/bids_dir
-v /path/to/output_dir:/out_dir
-v /path/to/work_dir:/work_dir
HBClab/nibetaseries:
nibs -c WhiteMatter CSF
–participant-label 001
-w {work_dir}
-a {atlas_mni_file}
-l {atlas_tsv}
{bids_dir}
fmriprep
{out_dir}
participant”

I aslo got their example script for running NiBetaseries, one of the command in the script is “nibs -c WhiteMatter CSF
–participant-label 001
-w {work_dir}
-a {atlas_mni_file}
-l {atlas_tsv}
{bids_dir}
fmriprep
{out_dir}
participant”

there is no error ,but it shows me that “b’/bin/sh: nibs: command not found\n’” - whether this is because I did not successfully install NiBetaSeries before?

Docker containers are self-contained computing environments. You should run this in your terminal. Make sure you alter the paths in the first command as needed to match your dataset. The second example script is for running in a Python environment, which we have not been successful in installing.

I tried to run this on my terminal but I dont think I can run it on terminal… I guess I might need to figure out a way to install this on python. I saw someone has the same issue but I did not see any solution with python.

I kept trying the method you told me, which is, run python -m pip install nibetaseries, right now the error is more about numpy, pandas, not matplotlib anymore. Here is the error message at the end:
“ERROR: Command errored out with exit status 1: /Users/jd/opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '”’"’/private/var/folders/xx/9wp086tx1nnbfntx9631wc1h0000gn/T/pip-install-inefc2zy/numpy_65aca55cac3148c0ba80cbf5afc4b2e8/setup.py’"’"’; file=’"’"’/private/var/folders/xx/9wp086tx1nnbfntx9631wc1h0000gn/T/pip-install-inefc2zy/numpy_65aca55cac3148c0ba80cbf5afc4b2e8/setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file) if os.path.exists(file) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /private/var/folders/xx/9wp086tx1nnbfntx9631wc1h0000gn/T/pip-record-dhvy6duo/install-record.txt --single-version-externally-managed --compile --install-headers /Users/jd/opt/anaconda3/include/python3.9/numpy Check the logs for full command output.
"

Thanks again for your patience Steven!

What kind of errors are you getting in terminal? What operating system are you using? Is docker in your terminal path?

Alternatively, if we want to try the python environment again, it might be best to start fresh in a new environment:

Start with conda create -n nib pip to get a new conda environment with pip installed.

Then conda activate nib to enter the environment.

Then pip install -U nibetaseries

1 Like

what I sent is the error message in terminal. I am using OS system Big Sur. I dont know whether docker is in my terminal path or not, I am very new to this docker stuff.

I ran what you just told me and I got basically same error message, the error message was very long, mostly it starts with something like “uninstall numpy”. If there is any way I can share with you about the long message, I am very happy to do so.

The error message in terminal you sent was for when you were installing with pip, I was referring to the the error message when trying the docker run command. You’ll know whether or not it’s in your path by whether terminal recognizes docker run as a command, but if docker pull worked then I imagine docker must be in your path.

You can post the new error message here too.

I guess I might miss something as it does not seem right, here is what I got after run the command on terminal:
-iMac:~ jd$ docker run -it --rm -v /path/to/bids_dir:/bids_dir \

                 -v /path/to/output_dir:/out_dir  \
                 -v /path/to/work_dir:/work_dir \
                 HBClab/nibetaseries:<version> \
                 nibs -c WhiteMatter CSF \
                       --participant-label 001 \
                       -w {work_dir} \
                       -a {atlas_mni_file} \
                       -l {atlas_tsv} \
                       {bids_dir} \
                       fmriprep \
                       {out_dir} \
                       participant

-bash: version: No such file or directory

The installation message is really long, so I attached it as txt file here for you, let me know if you have problem opening it. nibetaseries_install.txt (379.6 KB)

A few things:

  1. you need to change the /path/to/... paths at the top to map to the relevant directories for you. You should make sure all of the arguments match to your needs. The argument names are the same as in the python call. Everything before nibs relates to the docker run options (see here for more info) and then everything after nibs is the same as if you were running in python.
  2. It looks like you put version on a new line. You can delete the version argument anyway, all it does is tell you the version and exit.
  3. If you want to continue down the python route (which I do not recommend) perhaps opening an issue on the nibetaseries github page (or seeing if anyone has reported a similar issue there) would be a good move. But in general I prefer containers.

Dear, Steven,

I think you are the right person to ask a similar trouble. If you can give me an idea, that would be a huge help, before moving on to create my own script for obtaining betaseries.

I had been using the nibetaseries for a while within python. Recently, I blew up conda and all virtual environments. I am then unable to install the package as discussed in this thread. So, I decided to use docker.

The problem is that it does not work as I expected. Everything below nibs had been working fine in jupyterlab before. I also explicitly -v {derivatives_pipeline}:/derivatives_pipeline \ and give a directory instead of fmriprep for its positional argument.

Below is the error message. Of course the directory exists. I can’t solve this simple problem.

b’ raise NotADirectoryError(msg)\n’
b’NotADirectoryError: /Volumes/nova/projects/artists_2021/data/derivatives/fmriprep is not an available directory\n’

I would greatly appreciate your help.
Best,
Min-Suk

cmd = “”"
docker run -i --rm
-v {bids_dir}:/bids_dir
-v {out_dir}:/out_dir
-v {work_dir}:/work_dir
hbclab/nibetaseries:v0.6.0
nibs
–participant-label {subject_label}
–task-label {task_label}
–space-label {space_label}
–run-label {run_label}
–description-label {desc_label}
–confounds {regressor_names}
–estimator {estimator}
–hrf-model glover
-w {work_dir}
{normal}
{bids_dir}
fmriprep
{out_dir}
participant""".format(
subject_label = subject,
task_label = task,
space_label = space,
run_label = run,
desc_label = desc,
estimator = estimator,
bids_dir = data_path,
out_dir = beta_path,
regressor_names = regressor_names,
work_dir = work_path,
normal = ‘–normalize-betas’)

Hi,

What is the command you are passing into docker? Is it

docker run -i --rm
-v {bids_dir}:/bids_dir
-v {out_dir}:/out_dir
-v {work_dir}:/work_dir
hbclab/nibetaseries:v0.6.0
nibs
–participant-label {subject_label}
–task-label {task_label}
–space-label {space_label}
–run-label {run_label}
–description-label {desc_label}
–confounds {regressor_names}
–estimator {estimator}
–hrf-model glover
-w {work_dir}
{normal}
{bids_dir}
fmriprep
{out_dir}
participant

If so, the problem is that you are are binding -v {bids_dir}:/bids_dir, and then in your nibetaseries command, you pass in the full path,{bids_dir} as argument, when you should just be passing in /bids_dir as the argument, since that is how that path is mounted in the container.

Best,
Steven

Thanks a lot. It worked nicely now.

Best,
Min-Suk Kang

Just wanted to say that this solution worked for me! Summarized my problem and solution in a different post, so this thread doesn’t become too all-over-the-place
Thanks for the input, Steven :slight_smile: