Spaces:
Sleeping
Sleeping
fix: Simplify nano-graphrag installation without setup.py
Browse files- Add missing dependencies (graspologic, aioboto3) to requirements.txt
- Replace pip install -e with simple sys.path.insert approach
- Avoid setup.py issues completely by treating nano-graphrag as local module
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- app.py +6 -5
- requirements.txt +3 -1
app.py
CHANGED
|
@@ -15,15 +15,16 @@ import subprocess
|
|
| 15 |
import sys
|
| 16 |
|
| 17 |
def install_nano_graphrag():
|
| 18 |
-
"""
|
| 19 |
try:
|
| 20 |
-
#
|
| 21 |
nano_dir = os.path.join(os.getcwd(), "nano-graphrag")
|
| 22 |
-
|
| 23 |
-
|
|
|
|
| 24 |
return True
|
| 25 |
except Exception as e:
|
| 26 |
-
print(f"⚠️ Failed to
|
| 27 |
return False
|
| 28 |
|
| 29 |
# Try to import nano_graphrag, install if needed
|
|
|
|
| 15 |
import sys
|
| 16 |
|
| 17 |
def install_nano_graphrag():
|
| 18 |
+
"""Add nano-graphrag to Python path as simple module"""
|
| 19 |
try:
|
| 20 |
+
# Add nano-graphrag directory to Python path
|
| 21 |
nano_dir = os.path.join(os.getcwd(), "nano-graphrag")
|
| 22 |
+
if nano_dir not in sys.path:
|
| 23 |
+
sys.path.insert(0, nano_dir)
|
| 24 |
+
print("✅ nano-graphrag added to Python path")
|
| 25 |
return True
|
| 26 |
except Exception as e:
|
| 27 |
+
print(f"⚠️ Failed to add nano-graphrag to path: {e}")
|
| 28 |
return False
|
| 29 |
|
| 30 |
# Try to import nano_graphrag, install if needed
|
requirements.txt
CHANGED
|
@@ -11,4 +11,6 @@ networkx>=3.0
|
|
| 11 |
hnswlib>=0.7.0
|
| 12 |
nano-vectordb>=0.0.4
|
| 13 |
dspy-ai>=3.0.0
|
| 14 |
-
neo4j>=5.0.0
|
|
|
|
|
|
|
|
|
| 11 |
hnswlib>=0.7.0
|
| 12 |
nano-vectordb>=0.0.4
|
| 13 |
dspy-ai>=3.0.0
|
| 14 |
+
neo4j>=5.0.0
|
| 15 |
+
graspologic
|
| 16 |
+
aioboto3
|