Comments (4)
Yes, which is available in Python 3, and further, Python 2 is nearing end of life. You need to use Python 3.
from pydeface.
Hello,
I got this error too. I tried with python 3.8 and 3.7.5
Any suggestions on how to solve it?
This is the output:
------------
pydeface 2.0
------------
Traceback (most recent call last):
File "/usr/local/bin/pydeface", line 11, in <module>
load_entry_point('pydeface==2.0', 'console_scripts', 'pydeface')()
File "build/bdist.macosx-10.14-intel/egg/pydeface/__main__.py", line 116, in main
File "build/bdist.macosx-10.14-intel/egg/pydeface/utils.py", line 83, in deface_image
AttributeError: 'module' object has no attribute 'which'
Many thanks in advance :)
from pydeface.
I think you probably need to double check on the Python version - I can run both 3.8 and 3.7.5 in isolated environments (Docker) and show that the function does exist:
First here is Python 3.8
$ docker run -it python:3.8
Python 3.8.0 (default, Oct 17 2019, 05:36:36)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.which('ls')
'/bin/ls'
And Python 3.7.5
$ docker run -it python:3.7.5
Python 3.7.5 (default, Oct 19 2019, 00:03:48)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.which('ls')
'/bin/ls'
I think it's very likely that you are not using the version you think you are, or you are grabbing older versions on your python path. Take a look at:
shutil.__file__
'/usr/local/lib/python3.7/shutil.py'
to confirm where it's coming from.
from pydeface.
Hi @shiranoren , I know that @logophilus7 solved this issue by installing pydeface from my old fork here: https://github.com/ofgulban/pydeface
Maybe you can try doing the same.
from pydeface.
Related Issues (20)
- Reduce time needed for defacing HOT 2
- Not quite defaced HOT 5
- Mark images as defaced HOT 7
- [feature request] provide dicom directory as input HOT 4
- docker image HOT 2
- How to cite you? HOT 2
- Improper defacing before reorient HOT 3
- pydeface/pydeface/data/facemask.nii.gz is not a binary mask HOT 1
- Detail the list of FSL dependencies HOT 2
- Issue using pydeface on linux VM HOT 4
- nibabel.deprecator.ExpiredDeprecationError HOT 2
- How do I set the path? HOT 2
- Wrong registration with given mask and template HOT 2
- pydeface will choke on '(' in filename HOT 2
- How to save defaced output in a different directory (from input) when using --applyto argument. HOT 7
- inconsistent defacing results HOT 1
- [feature proposal] BIDS directory as input HOT 18
- FSL Not Found on Path for pydeface HOT 4
- FSL dependency check requires the complete FSL installation HOT 2
- Add Zenodo snippet to improve citation HOT 5
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 pydeface.