1

I am a beginner in Linux and I am trying to do something very basic (yet it does not seem to work).

I have installed a python3 package. I wish to run this Python package on a specific folder from my linux machine. The idea is that this package should restructure all my files in a specific format (this is the link to the package https://github.com/SIMEXP/Data2Bids ).

In the demo of the tutorial, it is mentioned that once I install the package:

pip3 install data2bids

I should just use cd on my desired folder that needs restructuring and then simply run data2bids.

After doing so, I received a command not found error.

I have tried to run the package using the python data2bids command (thinking that maybe I should mention it is a python package. I have tried to use the full path of where the package was installed in the command, yet it did not work. I even tried to install the package in the same folder as my directory that needs restructuring, with no results.

I believe that this is a very basic problem, and the solution may be very simple. Within a linux machine, how does one exactly run a python module in a specific folder?

  • 1
    Potential duplicate https://stackoverflow.com/a/59436732/20599896 – Cpt.Hook Dec 05 '22 at 14:41
  • have you tried `python -m data2bids` in your directory ? – DeaX StormZ Dec 05 '22 at 14:43
  • I have tried this also, I receive "No module named data2bids". Although this is strange, as the module is installed, so I assume the problem has to do with the path or something like that on how Linux works – Codrin Mironiuc Dec 05 '22 at 15:32
  • 1
    Try `which pip3` (to check which `pip3` you used to install the package), then `which python3` to check both are from the same installation, then probably `python3 -m data2bdis` works – Diego Torres Milano Dec 06 '22 at 19:12

1 Answers1

1

I am also a rookie in Linux, here's what i can think of.

First, the input is:

A directory containing some files in any extension, with names containing at minimum the information of modality and patient number. A .JSON configuration file explaining how the filenames should be read.

I assume you ran the command without the configuration file.

Second, Linux has built-in python whose version is 2.x, try to type python in command line and print python version, if it's 3.x, try to query pip installed list to see if the package was installed successfully, if not, see if the installed python 3.x directory is contained in PATH.

YXlukarov
  • 36
  • 3
  • thanks a lot! I realized now that I was actually not running Python3x so probably this is one reason why it would work. Just to check if my understanding is correct - once I update to Python 3x, I check if it was installed ok, then the pyhon3x directory should be in PATH to ensure that this command work work? – Codrin Mironiuc Dec 05 '22 at 16:17
  • and in regard to the first comment - I ran the package with the config.json file, but I thought that this is the way of doing it - they simply mentioned I should have the json file in the cwd and then just run "data2bids". Maybe I misunderstood? – Codrin Mironiuc Dec 05 '22 at 16:18