Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAMS is not registered correctly in show-versions #523

Open
glatterf42 opened this issue Mar 22, 2024 · 1 comment
Open

GAMS is not registered correctly in show-versions #523

glatterf42 opened this issue Mar 22, 2024 · 1 comment
Labels
Milestone

Comments

@glatterf42
Copy link
Member

Code sample or context

Recently, @behnam-zakeri tried to install message-ix again on a new Linux machine. The process went fine by creating a new virtual environment via virtualenv and virtualenvwrapper and we made sure that the directory for gams is in $PATH. This can be confirmed by running gams on the system; it seems to work both from the command line and as part of the westeros_baseline tutorial from message-ix. However, running

message-ix show-versions

tells us that 'gams' is not in PATH. Since everything else is working fine, my expectation is that this is due to an issue with the way that ixmp tries to find gams, not about the installation per se.

We should note that the Linux machine was not a fresh install. Things like pip and virtualenv or even venv were missing, which seems odd.

Expected result

message-ix show-versions, which is internally using https://github.com/iiasa/ixmp/blob/d202e019204e6cf979df6f2a827322a00dbd1957/ixmp/model/gams.py#L18C1-L50C20 should find the correct version of gams.

Problem description

It doesn't seem to find it at all.

Versions

@behnam-zakeri If you can edit this description, please add the output of message-ix show-versions here. Otherwise, please just paste it down below.

Output of ixmp show-versions
<!--
Run one of the following and paste the results here:
- 'ixmp show-versions' in a terminal, or
- 'import ixmp; ixmp.show_versions()' in a Python interpreter.
-->
@glatterf42 glatterf42 added the bug label Mar 22, 2024
@glatterf42 glatterf42 added this to the 3.9 milestone Mar 22, 2024
@khaeru
Copy link
Member

khaeru commented Mar 22, 2024

One way to debug this is to put for instance:

    print(os.environ)

    # Execute, capturing stdout
    output = check_output(
        ...
    )

    print(output)

…around the subject code.

Setting PATH can have some subtleties. For instance, if setting the value in .profile or a similar file, the value will appear in all new terminals opened after that addition. But if one has a terminal open prior, and does not do anything in it, then its prior value of PATH is not automatically updated.

@khaeru khaeru modified the milestones: 3.9, 3.10 Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants