rahulnyk/knowledge_graph

pip install requirements.txt conflict

Opened this issue · 8 comments

when I run “pip install -r requirements.txt”,It will show conflict following:

ERROR: Cannot install -r requirements.txt (line 109), -r requirements.txt (line 135), -r requirements.txt (line 80), -r requirements.txt (line 88) and jsonschema==4.19.0 because these package versions have conflicting dependencies.

The conflict is caused by:
The user requested jsonschema==4.19.0
jupyter-events 0.7.0 depends on jsonschema>=4.18.0
jupyterlab-server 2.24.0 depends on jsonschema>=4.17.3
nbformat 5.9.2 depends on jsonschema>=2.6
poetry 1.6.1 depends on jsonschema<4.18.0 and >=4.10.0

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

and if I cancel the limit about “poetry”,the other conflicting problem will happen,so I don't know how to do,thanks for you help!

You can remove Poetry from the requirements.txt
In this project, Poetry is not needed.
This is one thing I hate about python, package management is pretty terrible.
Ill try to repair the requirements.txt to bring it down to the minimum.

I have removed the requirements.txt altogether from the project.
Instead added poetry to the project.
Now if you have poetry installed in your Python version in use, just type poetry install
You should be good to go.

thank you so much for helping me to fix this problem,I reclone the project and try to ues poetry to install the package,but when I run “poetry install”,It would show problem following:

Installing the current project: knowlege-graph (0.1.0)
The current project could not be installed: No file/folder found for package knowlege-graph
If you do not want to install the current project use --no-root

first time I check ,I thought It was the mistake about project name(the bold word above),because the name in “pyproject.toml” is the “knowlege-graph”,then I changed the name to “knowledge-graph”,but when I run “poetry install”,it error again:

Installing the current project: knowledge-graph (0.1.0)
The current project could not be installed: No file/folder found for package knowledge-graph
If you do not want to install the current project use --no-root

and if I follow the suggestion and use “--no-root”,the all package were installed but the project cannot run successful,when code running to the second block in “extract_graph.ipynb”(block:Load Documents),the program will running endlessly,or end with error “Process finished with exit code -1073740791 (0xC0000409)”,after my debug ,I thought the mistake is in line 6:

documents = loader.load()

but I try everything and don't know how to fix it,thanks agein for your help!

Hi, Give me a day or two. I'll try to set it up myself and check.

Hi, Give me a day or two. I'll try to set it up myself and check.

thanks!I will also continue to check the problem

In worst case, don't use poetry.
Open pyproject.toml file and install the listed dependency packages manually.

python = "^3.11"
langchain = "^0.0.335"
pandas = "^2.1.3"
numpy = "^1.26.2"
pypdf = "^3.17.0"
unstructured = "^0.10.30"
pathlib = "^1.0.1"
networkx = "^3.2.1"
pyvis = "^0.3.2"
seaborn = "^0.13.0"
uuid = "^1.30"
jupyterlab = "^4.0.8"
yachalk = "^0.1.5"

thanks for your
advice,I trid install the listed dependency packages manually with pip,but unfortunately,the code still running failed,I will try other solution

20231114164900
20231114170715

I added a conda environment.yml as an alternative to poetry/pip venv and opened a pull request.