Poissonfish / GRID

GRID: Deal with Field Segmentations Elegantly
https://poissonfish.github.io/GRID/index.html
GNU General Public License v3.0
32 stars 11 forks source link

I missed the bug when I run commend "python -m grid" #4

Closed YixiangShan closed 3 years ago

YixiangShan commented 3 years ago

Describe the bug Hi, I created a new environment in anaconda and installed the "rasterio" and "photo_grid", following the instructions. Then I run the commend "python -m grid". But it failed to open the demo. 

To Reproduce Steps to reproduce the behavior:

  1. create a new environment named "GATTING" and activate it:

conda create -n GATTING conda activate GATTING

  1. install the rasterio

conda config --add channels conda-forge conda install rasterio

  1. install the photo_grid

python -m pip install photo_grid

  1. launch GRID

`python -m grid``

  1. The result is:

                 Welcome to GRID Ver.1.2.15
~~~~~~~~~*~~~~~~~~~*~~~~~~~~~*~~~~~~~~~*~~~~~~~~~*~~~~~~~~~
Author      : James Chen <chun-peng.chen@wsu.edu>
Last update : Feb 23, 2021
User manual : https://poissonfish.github.io/GRID/
~~~~~~~~~*~~~~~~~~~*~~~~~~~~~*~~~~~~~~~*~~~~~~~~~*~~~~~~~~~
Recent update
    - Add CRS to shapefiles (.prj)
    - Update user manual
    - Support ESRI shapefile compatible in QGIS
~~~~~~~~~*~~~~~~~~~*~~~~~~~~~*~~~~~~~~~*~~~~~~~~~*~~~~~~~~~
Traceback (most recent call last):
  File "D:\Coding\Anaconda\Anaconda\envs\GATTING\lib\runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "D:\Coding\Anaconda\Anaconda\envs\GATTING\lib\runpy.py", line 147, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "D:\Coding\Anaconda\Anaconda\envs\GATTING\lib\runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "D:\Coding\Anaconda\Anaconda\envs\GATTING\lib\site-packages\grid\__init__.py", line 72, in <module>
    from .grid import *
  File "D:\Coding\Anaconda\Anaconda\envs\GATTING\lib\site-packages\grid\grid.py", line 9, in <module>
    from .gimage import *
  File "D:\Coding\Anaconda\Anaconda\envs\GATTING\lib\site-packages\grid\gimage.py", line 6, in <module>
    from .io import *
  File "D:\Coding\Anaconda\Anaconda\envs\GATTING\lib\site-packages\grid\io.py", line 12, in <module>
    import rasterio
  File "D:\Coding\Anaconda\Anaconda\envs\GATTING\lib\site-packages\rasterio\__init__.py", line 9, in <module>
    from rasterio._base import gdal_version
ImportError: DLL load failed while importing _base: 找不到指定的程序。

Expected behavior The program runs normally.

Screenshots bug in GATTING

Desktop (please complete the following information):

Additional context I am a python beginner but I am really interested in this phenotyping program. I have tried the methods online, which asked me to install the packages again. Finally, I failed. Hope to get the answer. Thank you very much.

Poissonfish commented 3 years ago

Hi, Thanks for the feedback. This issue should be related to loading rasterio under Conda environment. I can't replicate your issue without looking into your environments settings (such as condo info), but I found some threads that might be helpful:

https://github.com/conda-forge/rasterio-feedstock/issues/149 https://github.com/ioos/conda-recipes/issues/775 https://stackoverflow.com/questions/55596662/rasterio-and-gdal-dll-load-fail-in-pycharm

Please keep me updated how does your case go, thank you.

James

YixiangShan commented 3 years ago

Thank you, James. The conda info is shown as the picture.

conda_info

I try this method (https://stackoverflow.com/questions/55596662/rasterio-and-gdal-dll-load-fail-in-pycharm). But I can not install gdal.

install gdal conda list

Is the gdal influnce rasterio running?

Thank you, Yixiang

Poissonfish commented 3 years ago

Seems you need to install gdal that support Python 3.9. According to your log, gdal-2 only support Python < 3.9