Comments (8)
Note to myself: Get the installation script to correctly identify the name of the shared libboost_python lib.
from medpy.
You can take a look at the logs of the installation process with:
pip install medpy --no-cache-dir --log LOG_FILE
Just remember to uninstall medpy
before. And the --no-cache-dir
flag is required to get pip
to re-compile the medpy
package from scratch.
Medpy
is set up such that it will try to compile the graphcut
extension. But when it fails at the task, it simply installs without it. In the logs you should see the failed compilation marked by the following lines:
2021-06-30T11:07:32,684 ***************************************************************************
2021-06-30T11:07:32,685 WARNING: The medpy.graphcut.maxflow external C++ package could not be compiled, all graphcut functionality will be disabled. You might be missing Boost.Python or some build essentials like g++.
2021-06-30T11:07:32,685 Failure information, if any, is above.
2021-06-30T11:07:32,685 I'm retrying the build without the graphcut C++ module now.
2021-06-30T11:07:32,685 ***************************************************************************
The error should be detailed in the lines just above.
One thing to look out for is to use Python 3. Ubuntu 20.04LTS still uses Python 2.7 as default, but supports Python 3. You can e.g. install medpy
in a virtual environment.
Alternatively, there might be a problem with the linking of the (lib)boost_python3
lib. There are some inconsistent naming conventions around that medpy
sometimes misses. At my local machine, the boost python package creates libboost_python38.so
under /usr/lib/x86_64-linux-gnu
, but medpy
looks for a generic libboost_python3.so
. This can be solved by entering the directory and creating a softlink with
sudo ln -s libboost_python38.so libboost_python3.so
Hope one of these solves your problems.
from medpy.
You were correct that libboost_python38.so
was the only file present in /usr/lib/x86_64-linux-gnu/libboost_python*
After creating the symbolic link as outlined above i managed to get the import working. It would be nice fix for the 1.0.0
release as sudo ln -s
requires containerisation in HPC environments.
However, pip install medpy --no-cache-dir
was not successful.
Instead, use pip install medpy --no-cache-dir --force-reinstall
.
Thanks for your help.
from medpy.
Does medpy
currently support CentOS 7
?
I have installed the deps
yum install -y \
gcc \
gcc-c++ \
kernel-devel \
make \
boost \
boost-devel \
boost-doc \
boost-python \
And created a symbolic link as follows
ln -s /lib64/libboost_python.so /lib64/libboost_python3.so
Installing medpy in a conda py38 environment
pip install --upgrade pip && pip install --no-cache-dir --force-reinstall \
medpy
I receive the following output after installation
>>> import medpy.graphcut
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/conda/lib/python3.8/site-packages/medpy/graphcut/__init__.py", line 200, in <module>
from .maxflow import GraphDouble, GraphFloat, GraphInt # this always triggers an error in Eclipse, but is right
ImportError: /opt/conda/lib/python3.8/site-packages/medpy/graphcut/maxflow.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE
Again, I appreciate your help.
from medpy.
Ah, im suspecting that the CentOS install only included python2.so files for boost.
from medpy.
For others looking for a CentOS 7 solution. Yum does not include the python3 libs by default. You will need to add the epel repo to access them.
yum install epel-release -y \
&& yum repolist -y \
&& yum install -y \
gcc \
gcc-c++ \
kernel-devel \
make \
boost*
This includes the correct file /lib64/libboost_python3.so
that is discoverable by medpy without the need for a symbolic link.
from medpy.
Thanks for all the work on CentOs!
from medpy.
Related Issues (20)
- Possible wrong result returned by medpy.io.load HOT 1
- Problem with opening .img/.img.hdr file HOT 1
- reduce redundant computation when computing multiple surface distance-based metrics HOT 3
- medpy.metric.binary.hd95(pre,gt) always get "1"、“1.414”、‘’1.732“.。。。 HOT 1
- Should Dice coefficient for empty result and empty reference be 1? HOT 1
- ASSD equation is wrong HOT 1
- scipy deprecations HOT 1
- anisotropic_diffusion slicer error HOT 3
- Numpy.bool is deprecated HOT 7
- Anisotropic Diffusion Numpy Warning (+ solution ?) HOT 2
- How to remove noise automatically without set any threshold value on DICOM Volume Images& 2D Images ? HOT 1
- When I use medpy.io.load to read .nii files,it always wrong. HOT 1
- Why I cannot load my CT volumns?
- metrics for multi-classes? HOT 1
- Handle few deprecations in scipy HOT 2
- Conda recipe with graphcut support HOT 2
- Broken links and incomplete notebooks HOT 2
- No module named 'load' HOT 1
- No module named 'medpy.graphcut.maxflow' HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from medpy.