External Email - Use Caution
Thanks, for your quick response.
I installed python2 and did set the default version to python 2.7.18 via
aliasing.
But I am getting the same old errors again. The same terminal responses
were listed below.
The subjects that are used for aseg/aparc are listed in the folder SUBJECTS
under freesurfer
$ asegstats2table --subjects Met001_1 Met002_1 --hemi lh --meas area
--tablefile Area_aseg_stats.txt
File "/usr/local/freesurfer/bin/aparcstats2table", line 156
print 'ERROR: atleast 1 subject must be provided'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean
print('ERROR: atleast 1 subject must be provided')?
$which python2
/usr/bin/python2
$ python --version
Python 2.7.18
$ export FREESURFER_HOME=/usr/local/freesurfer
$ source $FREESURFER_HOME/SetUpFreeSurfer.sh
-------- freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME /usr/local/freesurfer
FSFAST_HOME /usr/local/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR /usr/local/freesurfer/subjects
MNI_DIR /usr/local/freesurfer/mni
FSL_DIR /usr/local/fsl
$ sh aseg_stats_extraction.sh
File "/usr/local/freesurfer/bin/asegstats2table", line 195
print 'ERROR: subjects are not specified (use --subjects SUBJECTS)'
^
SyntaxError: invalid syntax
File "/usr/local/freesurfer/bin/asegstats2table", line 195
print 'ERROR: subjects are not specified (use --subjects SUBJECTS)'
^
SyntaxError: invalid syntax
File "/usr/local/freesurfer/bin/aparcstats2table", line 156
print 'ERROR: atleast 1 subject must be provided'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean
print('ERROR: atleast 1 subject must be provided')?
File "/usr/local/freesurfer/bin/aparcstats2table", line 156
print 'ERROR: atleast 1 subject must be provided'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean
print('ERROR: atleast 1 subject must be provided')?
I also attached the shell script file that I created for thickness and area
extraction from the list of subjects.
Is this because something is wrong in the bash_profile/bashrc file? I don't
know I am just guessing.
Any help would be appreciated!
Thanks,
Vittal
On Fri, Dec 30, 2022 at 12:29 AM fsbuild <[email protected]> wrote:
>
> SyntaxError: Missing parentheses in call to 'print'. Did you mean
> print('ERROR: atleast 1 subject must be provided')?
>
> It does not look like you are running a python 2.X. That may be because
> only python3 is installed by default.
>
> $ which python
> $ which python2
> $ which python3
> /bin/python3
>
> … if you need to install python2, you can do it with ...
>
> $ sudo apt update
> $ sudo apt install python2
>
> $ which python2
> /bin/python2
> $ python2 --version
> Python 2.7.18
>
> One way or another you need “python” to report it is a 2.X version *after*
> you set FREESURFER_HOME and source the freesurfer setup script. To force
> “python” to run as “python2” you can try using an alias,
>
> $ alias python=python2
> $ python --version
> Python 2.7.18
>
> Similarly, if you needed python to run as python3 you could reset the
> alias to use =python3 instead.
>
> For the error,
>
> print 'ERROR: subjects are not specified (use --subjects SUBJECTS)’
>
> I would check the subjects you are listing as argument can be found as
> directories under what SUBJECTS_DIR is currently set to.
>
> - R.
>
>
_______________________________________________
Freesurfer mailing list
[email protected]
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Mass General Brigham
Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline
<https://www.massgeneralbrigham.org/complianceline> .
Please note that this e-mail is not secure (encrypted). If you do not wish to
continue communication over unencrypted e-mail, please notify the sender of
this message immediately. Continuing to send or respond to e-mail after
receiving this message means you understand and accept this risk and wish to
continue to communicate over unencrypted e-mail.