hwchase17/notion-qa

NotImplementedError: cannot instantiate 'PosixPath' on your system

yogeshhk opened this issue · 3 comments

Traceback (most recent call last):
File "notion-qa-hwchase17\main.py", line 13, in
store = pickle.load(f)
File "..\AppData\Local\Continuum\anaconda3\envs\langchain\lib\pathlib.py", line 1084, in new
raise NotImplementedError("cannot instantiate %r on your system"
NotImplementedError: cannot instantiate 'PosixPath' on your system

I added this solution to the main.py and it fixes the problem:
https://stackoverflow.com/questions/57286486/i-cant-load-my-model-because-i-cant-put-a-posixpath

import pathlib
temp = pathlib.PosixPath
pathlib.PosixPath = pathlib.WindowsPath

Worked for me when added to top of qa.py rather than main.py

The origin of the issue, I think is within faiss_store.pkl, as a reference to a PosixPath is embedded.