Geoalert / aeronetlib

A Remote Sensing data handling library for Deep Learning
MIT License
31 stars 18 forks source link

Fix requirenments.txt #13

Open TC406 opened 4 years ago

TC406 commented 4 years ago

No errors during installation via pip install aeronetlib/. But then error fall down after trying to import aeronetlib:

from aeronet.converters.split import split
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.conda/envs/test_aeronetlib/lib/python3.7/site-packages/aeronet/converters/split.py", line 4, in <module>
    from ..dataset import BandCollection
  File "/home/user/.conda/envs/test_aeronetlib/lib/python3.7/site-packages/aeronet/dataset/__init__.py", line 8, in <module>
    from .vector import Feature
  File "/home/user/.conda/envs/test_aeronetlib/lib/python3.7/site-packages/aeronet/dataset/vector/__init__.py", line 1, in <module>
    from .feature import Feature, FeatureCollection
  File "/home/user/.conda/envs/test_aeronetlib/lib/python3.7/site-packages/aeronet/dataset/vector/feature.py", line 2, in <module>
    import rtree
ModuleNotFoundError: No module named 'rtree'

rtree Is imported from aeronet/dataset/vector/feature.py But there no rtree package in requirenments.txt . I tried to install rtree via pip https://pypi.org/project/Rtree/ but pip had fall following error.

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Collecting Rtree
  Using cached Rtree-0.9.3.tar.gz (520 kB)
    ERROR: Command errored out with exit status 1:
     command: home/user/.conda/envs/test_aeronetlib/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dgw70zvn/Rtree/setup.py'"'"'; __file
__='"'"'/tmp/pip-install-dgw70zvn/Rtree/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __f
ile__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-dgw70zvn/Rtree/pip-egg-info
         cwd: /tmp/pip-install-dgw70zvn/Rtree/
    Complete output (15 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-dgw70zvn/Rtree/setup.py", line 3, in <module>
        import rtree
      File "/tmp/pip-install-dgw70zvn/Rtree/rtree/__init__.py", line 1, in <module>
        from .index import Rtree
      File "/tmp/pip-install-dgw70zvn/Rtree/rtree/index.py", line 6, in <module>
        from . import core
      File "/tmp/pip-install-dgw70zvn/Rtree/rtree/core.py", line 145, in <module>
        rt.Error_GetLastErrorNum.restype = ctypes.c_int
      File "/home/user/.conda/envs/test_aeronetlib/lib/python3.7/ctypes/__init__.py", line 377, in __getattr__
        func = self.__getitem__(name)
      File "/home/user/.conda/envs/test_aeronetlib/lib/python3.7/ctypes/__init__.py", line 382, in __getitem__
        func = self._FuncPtr((name_or_ordinal, self))
    AttributeError: /home/.conda/envs/test_aeronetlib/bin/python: undefined symbol: Error_GetLastErrorNum
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I had success installing rtree via conda install -c conda-forge rtree.

Then another error occur:

from aeronet.converters.split import split
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.conda/envs/test_aeronetlib/lib/python3.7/site-packages/aeronet/converters/split.py", line 4, in <module>
    from ..dataset import BandCollection
  File "/home/user/.conda/envs/test_aeronetlib/lib/python3.7/site-packages/aeronet/dataset/__init__.py", line 11, in <module>
    from .io import Predictor
  File "/home/user/.conda/envs/test_aeronetlib/lib/python3.7/site-packages/aeronet/dataset/io.py", line 3, in <module>
    from tqdm import tqdm
ModuleNotFoundError: No module named 'tqdm'

tqdm installs successfully using pip or conda.

az09 commented 2 years ago

https://github.com/Geoalert/aeronetlib/commit/5c4aa9d8c1a8e7325ac48374af9163d84abc95f2#diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552 Maybe it's time to close it?