Giter Club home page Giter Club logo

Comments (4)

vsoch avatar vsoch commented on August 20, 2024

Yes, which is available in Python 3, and further, Python 2 is nearing end of life. You need to use Python 3.

from pydeface.

shiranoren avatar shiranoren commented on August 20, 2024

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.

vsoch avatar vsoch commented on August 20, 2024

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.

ofgulban avatar ofgulban commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.