CodeSchmiedeHGW / BLITZ

Bulk Loading and Interactive Time series Zonal analysis
GNU General Public License v3.0
1 stars 0 forks source link

Linux installation - Command not found after poetry install #17

Closed Fellypao closed 2 months ago

Fellypao commented 7 months ago

Hi,

I'm trying to install BLITZ on Linux following the install instructions from the README.md file. After a successful¹ installation BLITZ fails to run with a 'command not found error', as it can be seen in the code below.

¹


(blitz) fellype@plasma:BLITZ$ poetry install
Updating dependencies
Resolving dependencies... (1.3s)

Package operations: 11 installs, 1 update, 0 removals

  • Updating packaging (23.2 /home/fellype/progs_nao_instalaveis/blitz/lib/python3.9/site-packages -> 23.2)
  • Installing llvmlite (0.40.1)
  • Installing numpy (1.24.4)
  • Installing pyqt5-sip (12.13.0)
  • Installing qtpy (2.4.1)
  • Installing natsort (8.4.0)
  • Installing numba (0.57.1)
  • Installing opencv-python (4.8.1.78)
  • Installing psutil (5.9.6)
  • Installing pyqt5 (5.15.2)
  • Installing pyqtgraph (0.13.3)
  • Installing qdarkstyle (3.2.3)

Writing lock file

Installing the current project: BLITZ (1.0.1)
(blitz) fellype@plasma:BLITZ$ poetry run BLITZ
Command not found: BLITZ
(blitz) fellype@plasma:BLITZ$ 
irkri commented 7 months ago

Hi, thank you for the issue! I am not sure about this, but Linux should be case-sensitive to program names. I think it may install BLITZ as all lower-case blitz. Can you check whether poetry run blitz works? Also, this should do the same as python -m blitz. This command finds the folder blitz (lowercase) in the current directory you are in and looks for the blitz/__main__.py file in there as an entry point.

Fellypao commented 7 months ago

Hi, Thank you for your reply.

poetry run blitz leads to the same error (command not found) python -m blitz returns:

(blitz) fellype@plasma:BLITZ$ python -m blitz
Traceback (most recent call last):
  File "/usr/lib64/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib64/python3.9/runpy.py", line 147, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib64/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/home/fellype/progs_wo_installer/blitz/BLITZ/blitz/__init__.py", line 1, in <module>
    from . import data, layout
  File "/home/fellype/progs_wo_installer/blitz/BLITZ/blitz/data/__init__.py", line 1, in <module>
    from . import load, tools
  File "/home/fellype/progs_wo_installer/blitz/BLITZ/blitz/data/load.py", line 11, in <module>
    from ..tools import log
  File "/home/fellype/progs_wo_installer/blitz/BLITZ/blitz/tools.py", line 32, in <module>
    value: str | Sequence[float | int] | np.ndarray | None,
TypeError: unsupported operand type(s) for |: 'type' and 'type'
(blitz) fellype@plasma:BLITZ$

Maybe this last error can be due to the python version. But I'll not be able to check it in the next weeks.

irkri commented 7 months ago

Yes, the last error is caused by the python version as the "|" operator for type annotations only works from python version 3.10 onward. We currently only support version 3.11.

It turns out that I can replicate the problem with poetry run blitz on Windows, too. So lets focus on python -m blitz. I will change the README as soon as it is confirmed working on Linux, too.

The command poetry run _something_ executes _something_ in the current virtual environment. However, blitz was never installed as anything, it's just a bunch of python scripts in your current folder. Another use-case would be to connect these two commands if you did not activate the virtual environment, so poetry run python -m blitz executes python with all packages installed in the environment.