amazon-science / patchcore-inspection

Apache License 2.0
719 stars 146 forks source link

ModuleNotFoundError: No module named 'patchcore' #16

Closed xixivvv closed 2 years ago

xixivvv commented 2 years ago

Traceback (most recent call last): File "bin/run_patchcore.py", line 10, in import patchcore.backbones ModuleNotFoundError: No module named 'patchcore'

I followed the README and got this problem May I ask what's going on here?

FzJun26th commented 2 years ago

you could copy the patchcore folder to bin folder

Confusezius commented 2 years ago

You need to call the run_patchcore.py following https://github.com/amazon-research/patchcore-inspection/issues/3#issuecomment-1121235018

We will update the README to include this information!

petergehler commented 2 years ago

For a python module to be importable it needs to be in the PYTHONPATH. There are several ways to do, one would be to prepend to the call

env PYTHONPATH bin/run_patchcore.py ...

and another one to set it as an evironment variable, e.g. (replace the dir to point to the src folder of this package.

export PYTHONPATH=whereever/patchcore/is/installed/src/:${PYTHONPATH}
bin/run_patchcore.py ...