fredboudon / plantscan3d

An open-source GUI for reconstructing plant 3D architecture from laser scans.
Other
27 stars 11 forks source link

ImportError for connection_ui #19

Open FranzEricSchneider opened 1 year ago

FranzEricSchneider commented 1 year ago

Hi, I'm trying to get a reliable installation for this up and running, but I'm having difficulties. Since I've been having issues with setting up workable conda environments on my local machine (https://github.com/fredboudon/plantscan3d/issues/18) I'm trying instead from the continuumio/miniconda3 docker image, which is just a basic docker image with conda available.

Installation from that point is just

conda create -n pgl openalea.plantgl -c fredboudon -c conda-forge
conda activate pgl
conda install pyqglviewer -c fredboudon -c conda-forge
conda install openalea.mtg -c fredboudon -c conda-forge
apt-get update && apt-get install libgl1-mesa-glx ffmpeg libsm6 libxext6 -y
pip install pymongo
git clone https://github.com/fredboudon/plantscan3d.git
cd plantscan3d/
python3 setup.py install
plantscan3d

Unfortunately, it's breaking with the following error:

(pgl) root@b22becb2e2a5:/plantscan3d# plantscan3d
StdRelease
StdRelease
StdRelease
StdRelease
StdRelease
StdRelease
Generate Ui
StdRelease
Generate Ui
Traceback (most recent call last):
  File "/opt/conda/envs/pgl/bin/plantscan3d", line 33, in <module>
    sys.exit(load_entry_point('OpenAlea.PlantScan3D==1.3.0', 'gui_scripts', 'plantscan3d')())
  File "/opt/conda/envs/pgl/bin/plantscan3d", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/opt/conda/envs/pgl/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/opt/conda/envs/pgl/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/conda/envs/pgl/lib/python3.10/site-packages/OpenAlea.PlantScan3D-1.3.0-py3.10.egg/openalea/plantscan3d/main_window.py", line 26, in <module>
    from .database import dbeditor, db_connection
  File "/opt/conda/envs/pgl/lib/python3.10/site-packages/OpenAlea.PlantScan3D-1.3.0-py3.10.egg/openalea/plantscan3d/database/dbeditor.py", line 26, in <module>
    from .storage_connection import *
  File "/opt/conda/envs/pgl/lib/python3.10/site-packages/OpenAlea.PlantScan3D-1.3.0-py3.10.egg/openalea/plantscan3d/database/storage_connection.py", line 22, in <module>
    from . import connection_ui
ImportError: cannot import name 'connection_ui' from 'openalea.plantscan3d.database' (/opt/conda/envs/pgl/lib/python3.10/site-packages/OpenAlea.PlantScan3D-1.3.0-py3.10.egg/openalea/plantscan3d/database/__init__.py)
BartvanMarrewijk commented 1 year ago

So I had similar issues, and this example above had partly to do with pymongo, which is doing somethings. So I added the pymongo with conda before adding the pyglviewer, and I used the python3 setup install. See my installation insctructions below. Check if the export for the MTG works, because I also managed to install it with python3.7 but then the MTG export does not work... good luck

conda create --name openalea39 python=3.9
conda activate openalea39
conda install openalea.plantgl -c fredboudon -c conda-forge
conda install -c openalea3 -c conda-forge openalea.mtg
conda install pymongo
conda install pyqglviewer -c fredboudon -c conda-forge
## git clone https://github.com/fredboudon/plantscan3d, use python3 setup.py install!!
python3 setup.py install
plantscan3d