VForWaTer / metacatalog

Modular metadata management platform for environmental data.
https://vforwater.github.io/metacatalog
GNU General Public License v3.0
3 stars 1 forks source link

pip install metacatalog bug #187

Closed AlexDo1 closed 1 year ago

AlexDo1 commented 1 year ago

I just encountered the same bug we had with the installation of metacatalog on the server (see https://git.scc.kit.edu/vforwater/vforwater-docs-admin/-/blob/main/docs/jupyter.md#:~:text=Installation%20and%20usage%20of%20metacatalog), when trying to install metacatalog directly from pip: pip install metacatalog in a fresh conda environment.
When trying to use the CLI, the error message is exactly the same as on the server:

$ metacatalog connection -h
/home/alexander/anaconda3/envs/test_mc/bin/metacatalog: Zeile 1: from: Befehl nicht gefunden
/home/alexander/anaconda3/envs/test_mc/bin/metacatalog: Zeile 7: Syntaxfehler: Unerwartetes Dateiende.

Even though the file /home/.metacatalog/config.json exists on my PC (most probably from another metacatalog installation).

When installing in development mode (pip install -e .), everything works fine.

Jörg told me that he had the same problems when installing metacatalog on the server and locally.

@mmaelicke fyi

mmaelicke commented 1 year ago

Ok, this error is because the OS is executing the metacatalog (without file extension) script. This script is missing the shebang, which I added here: https://github.com/VForWaTer/metacatalog/compare/master...fix-cli

I am not sure if the set path can be found on all systems. I see different avenues to take here:

  1. try it with the updated file on the vofrwater server
  2. change the shebang to a python which can be found
  3. symlink the correct python environment at /usr/bin and verify the CLI is working
  4. remove the CLI altogether and use the CLI entry point as Python module: python -m meta catalog -h, which should work in any case.

I guess I am fine with all options except 2. Would prefer 4, if it is not working with the updated file

mmaelicke commented 1 year ago

BTW, this error message has nothing to do with the missing config.json on installation. @AlexDo1 can you verify that there is no config.json when pip install meta catalog? That is yet another issue

AlexDo1 commented 1 year ago

To try the updated file on the server or locally, we would have to create a new release on pip with the altered file to make pip install metacatalog work, as pip install -e . already works.

BTW, this error message has nothing to do with the missing config.json on installation. @AlexDo1 can you verify that there is no config.json when pip install meta catalog? That is yet another issue

For that I would have to remove my old config.json and see if a new one is created in the installation.

mmaelicke commented 1 year ago

To try the updated file on the server or locally, we would have to create a new release on pip with the altered file to make pip install metacatalog work, as pip install -e . already works.

That means the editable installation can call the metacatalog CLI, but the normal install command not? I can't find any difference in the two implementations. I can't see any quick fix here, no idea what the problem is. In this case, we should deprecate the metacatalog CLI and update the docs to always use python -m metacatalog

For that I would have to remove my old config.json and see if a new one is created in the installation.

Renaming the .metacatalog folder to .metacatalog_save or something would already be sufficient.