Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotImplementedError: cannot instantiate 'PosixPath' on your system #12

Open
yogeshhk opened this issue Mar 21, 2023 · 3 comments
Open

Comments

@yogeshhk
Copy link

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

@G1213123
Copy link

G1213123 commented Mar 22, 2023

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

@DanielThaumazo
Copy link

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

@DanielThaumazo
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants