Python3 installation failure: gcc error
running build_ext
cythoning whitematteranalysis/fibers.pyx to whitematteranalysis/fibers.c
/tmp/pip-req-build-zz__lcdf/.eggs/Cython-3.0a6-py3.7.egg/Cython/Compiler/Main.py:344: FutureWarning: Cython directive 'l anguage_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-req-build-zz__l cdf/whitematteranalysis/fibers.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
------------------------------------------------------------
...
if __debug__:
# this tests we output the last point on the line
#test = ((output_line_length - 1) * step == input_line_length - 1)
test = (round(ptidx*step) == input_line_length-1)
if not test:
print "<fibers.py> ERROR: fiber numbers don't add up."
^
------------------------------------------------------------
whitematteranalysis/fibers.pyx:176:22: Syntax error in simple statement list
cythoning whitematteranalysis/similarity.pyx to whitematteranalysis/similarity.c
/tmp/pip-req-build-zz__lcdf/.eggs/Cython-3.0a6-py3.7.egg/Cython/Compiler/Main.py:344: FutureWarning: Cython directive 'l anguage_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-req-build-zz__l cdf/whitematteranalysis/similarity.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
------------------------------------------------------------
...
"""
if distance_method == 'Landmarks':
return _fiber_distance_internal_landmarks(fiber, fiber_array, fiber_landmarks, landmarks)
if landmarks is not None:
print "ERROR: Please use distance method Landmarks to compute landmark distances"
^
------------------------------------------------------------
whitematteranalysis/similarity.pyx:95:14: Syntax error in simple statement list
building 'whitematteranalysis.fibers' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/whitematteranalysis
gcc -pthread -B /data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -f wrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-req-build-zz__lcdf/.eggs/numpy-1.19.1-py3.7-linux-x86_64.egg/numpy/co re/include -I/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/include/python3.7m -c whitematteranalysis/fibers.c -o build/temp.l inux-x86_64-3.7/whitematteranalysis/fibers.o
whitematteranalysis/fibers.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for WhiteMatterAnalysis
Running setup.py clean for WhiteMatterAnalysis
You should be able to reproduce this on grx05:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86.sh
sh Miniconda3-latest-Linux-x86.sh -b -p miniconda3-wma
source miniconda3-wma/bin/activate
pip install git+https://github.com/SlicerDMRI/whitematteranalysis.git
Don't these print statements need parentheses before and after? https://github.com/SlicerDMRI/whitematteranalysis/blob/master/whitematteranalysis/similarity.pyx#L95
Commenting out active print statements from the following solved this problem:
(base) [tb571@grx06 whitematteranalysis]$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: whitematteranalysis/fibers.py
# modified: whitematteranalysis/fibers.pyx
# modified: whitematteranalysis/similarity.py
# modified: whitematteranalysis/similarity.pyx
I don't know which ones do you want to keep active, so it would be upon you to fix/omit them.
Actually, it didn't. Upon installation, now I run into the following error:
cd whitematteranalysis python setup.py install
(wma) [tb571@grx06 whitematteranalysis]$ wm_quality_control_tractography.py -h
Importing whitematteranalysis package.
<wm_register.py> Error importing white matter analysis package
Traceback (most recent call last):
File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/bin/wm_quality_control_tractography.py", line 4, in <module>
__import__('pkg_resources').run_script('WhiteMatterAnalysis==0.3.0', 'wm_quality_control_tractography.py')
File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/pkg_resources/__init__.py", line 661, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1441, in run_script
exec(code, namespace, namespace)
File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/WhiteMatterAnalysis-0.3.0-py3.7-linux-x86_64.egg/EGG-INFO/scripts/wm_quality_control_tractography.py", line 14, in <module>
import whitematteranalysis as wma
File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/WhiteMatterAnalysis-0.3.0-py3.7-linux-x86_64.egg/whitematteranalysis/__init__.py", line 2, in <module>
from . import io, fibers, filter, laterality, render, cluster, relative_distance, mrml, congeal_multisubject, register_two_subjects, register_two_subjects_nonrigid, register_two_subjects_nonrigid_bsplines, congeal_to_atlas, tract_measurement
File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/WhiteMatterAnalysis-0.3.0-py3.7-linux-x86_64.egg/whitematteranalysis/io.py", line 29, in <module>
from . import render
File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/WhiteMatterAnalysis-0.3.0-py3.7-linux-x86_64.egg/whitematteranalysis/render.py", line 8, in <module>
from . import filter
File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/WhiteMatterAnalysis-0.3.0-py3.7-linux-x86_64.egg/whitematteranalysis/filter.py", line 31, in <module>
from . import fibers, similarity
File "whitematteranalysis/similarity.pyx", line 3, in init whitematteranalysis.similarity
import fibers
ModuleNotFoundError: No module named 'fibers'
Don't these print statements need parentheses before and after? https://github.com/SlicerDMRI/whitematteranalysis/blob/master/whitematteranalysis/similarity.pyx#L95
Yes, this needs to be updated. Will update in the next few days. Thanks for noticing this!
Actually, it didn't. Upon installation, now I run into the following error:
cd whitematteranalysis python setup.py install
(wma) [tb571@grx06 whitematteranalysis]$ wm_quality_control_tractography.py -h Importing whitematteranalysis package. <wm_register.py> Error importing white matter analysis package Traceback (most recent call last): File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/bin/wm_quality_control_tractography.py", line 4, in <module> __import__('pkg_resources').run_script('WhiteMatterAnalysis==0.3.0', 'wm_quality_control_tractography.py') File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/pkg_resources/__init__.py", line 661, in run_script self.require(requires)[0].run_script(script_name, ns) File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1441, in run_script exec(code, namespace, namespace) File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/WhiteMatterAnalysis-0.3.0-py3.7-linux-x86_64.egg/EGG-INFO/scripts/wm_quality_control_tractography.py", line 14, in <module> import whitematteranalysis as wma File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/WhiteMatterAnalysis-0.3.0-py3.7-linux-x86_64.egg/whitematteranalysis/__init__.py", line 2, in <module> from . import io, fibers, filter, laterality, render, cluster, relative_distance, mrml, congeal_multisubject, register_two_subjects, register_two_subjects_nonrigid, register_two_subjects_nonrigid_bsplines, congeal_to_atlas, tract_measurement File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/WhiteMatterAnalysis-0.3.0-py3.7-linux-x86_64.egg/whitematteranalysis/io.py", line 29, in <module> from . import render File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/WhiteMatterAnalysis-0.3.0-py3.7-linux-x86_64.egg/whitematteranalysis/render.py", line 8, in <module> from . import filter File "/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/lib/python3.7/site-packages/WhiteMatterAnalysis-0.3.0-py3.7-linux-x86_64.egg/whitematteranalysis/filter.py", line 31, in <module> from . import fibers, similarity File "whitematteranalysis/similarity.pyx", line 3, in init whitematteranalysis.similarity import fibers ModuleNotFoundError: No module named 'fibers'
Can you try to install using pip, as in the below link:
https://github.com/SlicerDMRI/whitematteranalysis#wma-installation
Can you try to install using pip, as in the below link:
That's where I started, but for the erroneous prints, it fails. So, I had to locally edit those prints and try python setup.py install.
But I also tried pip install whitematteranalysis/ locally only to run into the same problem.
By the way, I got a news for you, only the following works with your existing *pyx files:
conda create -y -n wma python=2.7.13 && \
conda activate wma && \
git+https://github.com/SlicerDMRI/whitematteranalysis.git@fa98f26087d6cf26fcb2a1d50a7a18d73c361d93
Pay attention to the python version (I was surprised too) and git hash.
Given my experience and your https://github.com/SlicerDMRI/whitematteranalysis/issues/93#issuecomment-670704067, I would be interested to know where you tested it and didn't run into any problems.
The python 3 version has been tested by me and several of our group members. I am not entirely sure about Windows, but it works well on Mac and Linux.
On Aug 8, 2020, at 9:35 PM, Tashrif Billah <[email protected]mailto:[email protected]> wrote:
Given my experience and your #93 (comment)https://github.com/SlicerDMRI/whitematteranalysis/issues/93#issuecomment-670704067, I would be interested to know where you tested it and didn't run into any problems.
I am not entirely sure about Windows, but it works well on Mac and Linux.
The above issue is from grx06.research.partners.org which runs CentOS 7 Linux. You should be able to reproduce it there.
Thanks for letting me know. I will give a try there.
Regards, Fan
On Aug 8, 2020, at 9:51 PM, Tashrif Billah <[email protected]mailto:[email protected]> wrote:
I am not entirely sure about Windows, but it works well on Mac and Linux.
The above issue is from grx06.research.partners.orghttp://grx06.research.partners.org which runs CentOS 7 Linux. You should be able to reproduce it there.
The python 3 version has been tested by me and several of our group members.
Yes, this needs to be updated. Will update in the next few days.
Given two of your comments, you should NOT be able to install it at all! Could it be the case that you have some local changes yet to push up?
@zhangfanmark is a PRO user so we would expect you to comment right on GitHub and not from email :)
As you can see, reply via email would put up a lot of trailing texts :D
The python 3 version has been tested by me and several of our group members.
Yes, this needs to be updated. Will update in the next few days.
Given two of your comments, you should NOT be able to install it at all! Could it be the case that you have some local changes yet to push up?
There is something mystery here, as you aways can see when it runs on different computers : )
The print statement should be fixed, but it does not break the code. Just to assure you and myself, I did a test on my local computer. It runs well. Also, I tested on grx06. There is nothing stoping me from installing WMA there. I am attaching the full log here.
This is from a newly installed Miniconda. Perhaps there are some conflicts to the PNL environment?
-bash-4.2$ source /PHShome/fz040/.bashrc
(base) -bash-4.2$ which conda
~/software/Miniconda3p8/miniconda3/bin/conda
(base) -bash-4.2$ conda create -n wma3p7p4 python=3.7.4
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: done
## Package Plan ##
environment location: /PHShome/fz040/software/Miniconda3p8/miniconda3/envs/wma3p7p4
added / updated specs:
- python=3.7.4
The following packages will be downloaded:
package | build
---------------------------|-----------------
ca-certificates-2020.6.24 | 0 125 KB
certifi-2020.6.20 | py37_0 156 KB
libedit-3.1.20191231 | h14c3975_1 116 KB
libffi-3.2.1 | hd88cf55_4 40 KB
pip-20.2.1 | py37_0 1.7 MB
python-3.7.4 | h265db76_1 32.1 MB
readline-7.0 | h7b6447c_5 324 KB
setuptools-49.2.1 | py37_0 743 KB
sqlite-3.32.3 | h62c20be_0 1.1 MB
tk-8.6.10 | hbc83047_0 3.0 MB
wheel-0.34.2 | py37_0 51 KB
------------------------------------------------------------
Total: 39.4 MB
The following NEW packages will be INSTALLED:
_libgcc_mutex pkgs/main/linux-64::_libgcc_mutex-0.1-main
ca-certificates pkgs/main/linux-64::ca-certificates-2020.6.24-0
certifi pkgs/main/linux-64::certifi-2020.6.20-py37_0
libedit pkgs/main/linux-64::libedit-3.1.20191231-h14c3975_1
libffi pkgs/main/linux-64::libffi-3.2.1-hd88cf55_4
libgcc-ng pkgs/main/linux-64::libgcc-ng-9.1.0-hdf63c60_0
libstdcxx-ng pkgs/main/linux-64::libstdcxx-ng-9.1.0-hdf63c60_0
ncurses pkgs/main/linux-64::ncurses-6.2-he6710b0_1
openssl pkgs/main/linux-64::openssl-1.1.1g-h7b6447c_0
pip pkgs/main/linux-64::pip-20.2.1-py37_0
python pkgs/main/linux-64::python-3.7.4-h265db76_1
readline pkgs/main/linux-64::readline-7.0-h7b6447c_5
setuptools pkgs/main/linux-64::setuptools-49.2.1-py37_0
sqlite pkgs/main/linux-64::sqlite-3.32.3-h62c20be_0
tk pkgs/main/linux-64::tk-8.6.10-hbc83047_0
wheel pkgs/main/linux-64::wheel-0.34.2-py37_0
xz pkgs/main/linux-64::xz-5.2.5-h7b6447c_0
zlib pkgs/main/linux-64::zlib-1.2.11-h7b6447c_3
Proceed ([y]/n)? y
Downloading and Extracting Packages
sqlite-3.32.3 | 1.1 MB | ########################################################################################################################################################################################################################## | 100%
setuptools-49.2.1 | 743 KB | ########################################################################################################################################################################################################################## | 100%
libffi-3.2.1 | 40 KB | ########################################################################################################################################################################################################################## | 100%
libedit-3.1.20191231 | 116 KB | ########################################################################################################################################################################################################################## | 100%
wheel-0.34.2 | 51 KB | ########################################################################################################################################################################################################################## | 100%
tk-8.6.10 | 3.0 MB | ########################################################################################################################################################################################################################## | 100% pip-20.2.1 | 1.7 MB | ########################################################################################################################################################################################################################## | 100%
readline-7.0 | 324 KB | ########################################################################################################################################################################################################################## | 100%
certifi-2020.6.20 | 156 KB | ########################################################################################################################################################################################################################## | 100%
python-3.7.4 | 32.1 MB | ########################################################################################################################################################################################################################## | 100%
ca-certificates-2020 | 125 KB | ########################################################################################################################################################################################################################## | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate wma3p7p4
#
# To deactivate an active environment, use
#
# $ conda deactivate
(base) -bash-4.2$ conda activate wma3p7p4
(wma3p7p4) -bash-4.2$ pip install git+https://github.com/SlicerDMRI/whitematteranalysis.git
Collecting git+https://github.com/SlicerDMRI/whitematteranalysis.git
Cloning https://github.com/SlicerDMRI/whitematteranalysis.git to /tmp/pip-req-build-c898q14e
Collecting cython
Using cached Cython-0.29.21-cp37-cp37m-manylinux1_x86_64.whl (2.0 MB)
Collecting numpy
Using cached numpy-1.19.1-cp37-cp37m-manylinux2010_x86_64.whl (14.5 MB)
Requirement already satisfied: setuptools in ./miniconda3/envs/wma3p7p4/lib/python3.7/site-packages (from WhiteMatterAnalysis==0.3.0) (49.2.1.post20200807)
Collecting scipy
Downloading scipy-1.5.2-cp37-cp37m-manylinux1_x86_64.whl (25.9 MB)
|████████████████████████████████| 25.9 MB 17.5 MB/s
Collecting vtk
Downloading vtk-9.0.1-cp37-cp37m-manylinux2010_x86_64.whl (103.4 MB)
|████████████████████████████████| 103.4 MB 112 kB/s
Collecting joblib
Downloading joblib-0.16.0-py3-none-any.whl (300 kB)
|████████████████████████████████| 300 kB 35.5 MB/s
Collecting statsmodels
Downloading statsmodels-0.11.1-cp37-cp37m-manylinux1_x86_64.whl (8.7 MB)
|████████████████████████████████| 8.7 MB 19.3 MB/s
Collecting xlrd
Downloading xlrd-1.2.0-py2.py3-none-any.whl (103 kB)
|████████████████████████████████| 103 kB 45.7 MB/s
Collecting matplotlib
Downloading matplotlib-3.3.0-1-cp37-cp37m-manylinux1_x86_64.whl (11.5 MB)
|████████████████████████████████| 11.5 MB 49.9 MB/s
Collecting nibabel
Downloading nibabel-3.1.1-py3-none-any.whl (3.3 MB)
|████████████████████████████████| 3.3 MB 30.9 MB/s
Collecting pandas>=0.21
Downloading pandas-1.1.0-cp37-cp37m-manylinux1_x86_64.whl (10.5 MB)
|████████████████████████████████| 10.5 MB 56.0 MB/s
Collecting patsy>=0.5
Using cached patsy-0.5.1-py2.py3-none-any.whl (231 kB)
Collecting pillow>=6.2.0
Downloading Pillow-7.2.0-cp37-cp37m-manylinux1_x86_64.whl (2.2 MB)
|████████████████████████████████| 2.2 MB 25.2 MB/s
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3
Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
|████████████████████████████████| 67 kB 1.6 MB/s
Collecting kiwisolver>=1.0.1
Downloading kiwisolver-1.2.0-cp37-cp37m-manylinux1_x86_64.whl (88 kB)
|████████████████████████████████| 88 kB 2.1 MB/s
Collecting python-dateutil>=2.1
Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting cycler>=0.10
Using cached cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Collecting packaging>=14.3
Downloading packaging-20.4-py2.py3-none-any.whl (37 kB)
Collecting pytz>=2017.2
Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB)
|████████████████████████████████| 510 kB 32.5 MB/s
Collecting six
Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Building wheels for collected packages: WhiteMatterAnalysis
Building wheel for WhiteMatterAnalysis (setup.py) ... done
Created wheel for WhiteMatterAnalysis: filename=WhiteMatterAnalysis-0.3.0-cp37-cp37m-linux_x86_64.whl size=907994 sha256=904b5037cd054e426a47db2f49fbd9b1c471bc18a5a1e76e53f8a4131966f297
Stored in directory: /tmp/pip-ephem-wheel-cache-k96d6smg/wheels/5d/7e/d1/ec3f0a6379325d42b325e13fce6ebba821c9637e114ad49d5f
Successfully built WhiteMatterAnalysis
Installing collected packages: cython, numpy, scipy, vtk, joblib, six, python-dateutil, pytz, pandas, patsy, statsmodels, xlrd, pillow, pyparsing, kiwisolver, cycler, matplotlib, packaging, nibabel, WhiteMatterAnalysis
Successfully installed WhiteMatterAnalysis-0.3.0 cycler-0.10.0 cython-0.29.21 joblib-0.16.0 kiwisolver-1.2.0 matplotlib-3.3.0 nibabel-3.1.1 numpy-1.19.1 packaging-20.4 pandas-1.1.0 patsy-0.5.1 pillow-7.2.0 pyparsing-2.4.7 python-dateutil-2.8.1 pytz-2020.1 scipy-1.5.2 six-1.15.0 statsmodels-0.11.1 vtk-9.0.1 xlrd-1.2.0
(wma3p7p4) -bash-4.2$ wm_quality_control_tractography.py -h
Importing whitematteranalysis package.
usage: wm_quality_control_tractography.py [-h] inputDirectory outputDirectory
Perform quality control steps (rendering images and fiber length testing) for
all vtk and vtp files in the input directory.
positional arguments:
inputDirectory A directory of whole-brain tractography as vtkPolyData
(.vtk or .vtp).
outputDirectory Quality control information will be stored in the output
directory, which will be created if it does not exist.
optional arguments:
-h, --help show this help message and exit
Written by Lauren O'Donnell, [email protected]. Please reference
"O'Donnell, Lauren J., and C-F. Westin. Automatic tractography segmentation
using a high-dimensional white matter atlas. Medical Imaging, IEEE
Transactions on 26.11 (2007): 1562-1575."
@zhangfanmark is a
PROuser so we would expect you to comment right on GitHub and not from email :) As you can see, reply via email would put up a lot of trailing texts :D
Opps, did not know it would show in that way... deleted the extra text in my reply : )
Thanks @zhangfanmark , I am going to try yours. But can you show us relevant contents from your /PHShome/fz040/.bashrc ?
Only conda initialize there in my bashrc:
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/PHShome/fz040/software/Miniconda3p8/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/PHShome/fz040/software/Miniconda3p8/miniconda3/etc/profile.d/conda.sh" ]; then
. "/PHShome/fz040/software/Miniconda3p8/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/PHShome/fz040/software/Miniconda3p8/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
My installer gets Python 3.7.0 as default, which is what you recommended in the README.md. But you have installed Python 3.7.4. Here is my log with the former:
copying whitematteranalysis/laterality.py -> build/lib.linux-x86_64-3.7/whitematteranalysis
copying whitematteranalysis/congeal_multisubject.py -> build/lib.linux-x86_64-3.7/whitematteranalysis
running build_ext
cythoning whitematteranalysis/fibers.pyx to whitematteranalysis/fibers.c
/tmp/pip-req-build-50ulj73n/.eggs/Cython-3.0a6-py3.7.egg/Cython/Compiler/Main.py:344: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-req-build-50ulj73n/whitematteranalysis/fibers.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
------------------------------------------------------------
...
if __debug__:
# this tests we output the last point on the line
#test = ((output_line_length - 1) * step == input_line_length - 1)
test = (round(ptidx*step) == input_line_length-1)
if not test:
print "<fibers.py> ERROR: fiber numbers don't add up."
^
------------------------------------------------------------
whitematteranalysis/fibers.pyx:176:22: Syntax error in simple statement list
cythoning whitematteranalysis/similarity.pyx to whitematteranalysis/similarity.c
/tmp/pip-req-build-50ulj73n/.eggs/Cython-3.0a6-py3.7.egg/Cython/Compiler/Main.py:344: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-req-build-50ulj73n/whitematteranalysis/similarity.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
------------------------------------------------------------
...
"""
if distance_method == 'Landmarks':
return _fiber_distance_internal_landmarks(fiber, fiber_array, fiber_landmarks, landmarks)
if landmarks is not None:
print "ERROR: Please use distance method Landmarks to compute landmark distances"
^
------------------------------------------------------------
whitematteranalysis/similarity.pyx:95:14: Syntax error in simple statement list
building 'whitematteranalysis.fibers' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/whitematteranalysis
gcc -pthread -B /data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/tmp/pip-req-build-50ulj73n/.eggs/numpy-1.19.1-py3.7-linux-x86_64.egg/numpy/core/include -I/data/pnl/soft/pnlpipe3/tmp/miniconda3-wma/include/python3.7m -c whitematteranalysis/fibers.c -o build/temp.linux-x86_64-3.7/whitematteranalysis/fibers.o
whitematteranalysis/fibers.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for WhiteMatterAnalysis
Running setup.py clean for WhiteMatterAnalysis
Failed to build WhiteMatterAnalysis
Installing collected packages: cython, numpy, scipy, vtk, joblib, patsy, python-dateutil, pytz, pandas, statsmodels, xlrd, pillow, pyparsing, kiwisolver, cycler, matplotlib, packaging, nibabel, WhiteMatterAnalysis
Running setup.py install for WhiteMatterAnalysis ... done
Successfully installed WhiteMatterAnalysis-0.3.0 cycler-0.10.0 cython-0.29.21 joblib-0.16.0 kiwisolver-1.2.0 matplotlib-3.3.0 nibabel-3.1.1 numpy-1.19.1 packaging-20.4 pandas-1.1.0 patsy-0.5.1 pillow-7.2.0 pyparsing-2.4.7 python-dateutil-2.8.1 pytz-2020.1 scipy-1.5.2 statsmodels-0.11.1 vtk-8.1.2 xlrd-1.2.0
Although I see the message Failed building wheel for WhiteMatterAnalysis, I can print the help message wm_quality_control_tractography.py -h.
However, I confirm that there is no error with what you did. So, maybe worth noting here that Python >= 3.7.4 is required?
By the way, why don't you try wm_quality_control_tractography.py /data/pnl/clk7/TRACTS/QC/tract_test ~/wma-py3-out/ with what you just installed?
Reference: https://github.com/SlicerDMRI/whitematteranalysis/issues/93