Closed d2hydro closed 1 year ago
-
Andere python environments werken niet meer direct door de plugin installatie. Dit komt omdat we in "C:\Users\wvangerwen.ipython\profile_default\ipython_config.py" dependencies toevoegen. Dit bestand wordt gedeeld met andere envs.
Onderaan dit bestand komt bijvoorbeeld dit te staan.
c.InteractiveShellApp.exec_lines = ['import sys; sys.path.insert(0,"C:/Users/wvangerwen/AppData/Roaming/3Di/QGIS3/profiles/default/python/plugins/ThreeDiToolbox/deps"); sys.path.insert(0,"C:/Users/wvangerwen/AppData/Roaming/3Di/QGIS3/profiles/default/python/plugins/hhnk_threedi_plugin/external-dependencies"); sys.path.insert(0,"E:/github/wvangerwen/hhnk-threedi-tools"); sys.path.insert(0,"E:/github/wvangerwen/hhnk-research-tools")']
Huidige oplossing om bovenaan alle scripts die andere env gebruiken deze dingen weer weg te halen.
import sys, os
from pathlib import Path
def fix_syspath(verbose=False):
r"""remove path things that are added in C:\Users\wvangerwen\.ipython\profile_default\ipython_config.py"""
syspath=sys.path.copy()
syspathlib = [Path(j) for j in syspath]
for ii, i in enumerate(['E:/github/wvangerwen/hhnk-threedi-tools',
os.path.join(os.getenv("APPDATA"), r"3Di/QGIS3/profiles/default/python/plugins/hhnk_threedi_plugin/external-dependencies"),
os.path.join(os.getenv("APPDATA"), r"3Di/QGIS3/profiles/default/python/plugins/ThreeDiToolbox/deps"),
os.path.join(os.getenv("APPDATA"), r"\\Python\\Python39\\site-packages")]):
if Path(i) in syspathlib:
index = syspathlib.index(Path(i))
sys.path.remove(syspath[index])
if verbose:
print(f"remove {syspath[index]}")
else:
if verbose:
print(f"error {Path(i)}")
-
-
@wvangerwen, zie nieuwe user-docs. Kun jij reviewen en publishen?
Ik heb een nieuwe MI + plugin installatie doorlopen om deze manual te doorlopen, dus bij mij werkt het :-)
Plugin kan nu gedownloade worden via: https://github.com/threedi/hhnk-threedi-plugin/releases/latest
Documentatie wordt nu automatisch gegenereerd @ release: https://threedi.github.io/hhnk-threedi-plugin/
Idee installatie:
MI downloaden en installeren: https://docs.3di.live/f_3di_instruments_and_downloads.html#di-instruments-and-downloads
QGIS opstarten, afsluiten, opstarten om 3Di plugin werkend te krijgen.
HHNK-plugin downloaden (https://github.com/threedi/hhnk-threedi-plugin) en dan de map hhnk_threedi_plugin (dus niet _main) in je appdata zetten;
%appdata%\Roaming\3Di\QGIS3\profiles\default\python\plugins\hhnk_threedi_plugin
Local_settings_default.py naar local_settings.py hernoemen.
Qgis afsluiten, opstarten om hhnk plugin te installeren (aanvinken in plugins qgis)
Procedure doorlopen, code + handleiding verbeteren:
Updaten depencies.py
Deployment toevoegen:
Documentatie uitwerken:
Kijken of we dit kunnen verbeteren: https://github.com/threedi/hhnk-threedi-plugin/issues/38#issuecomment-1447881974