Installing GAMSPy for the very first time

Hi,
The Installation guide (Installation and Licensing — GAMSPy documentation) says that “you can run the following command to install GAMSPy from PyPI: pip install gamspy”. I ran this command in Python 3.12 and in Python IDLE Shell (3.12), both returned “SyntaxError: invalid syntax”. I ran this command in PyCharm Community Edition (2024.2.1), it didn’t work either. Please provide more detailed information on how to install GAMSPy. Thanks.

Hi,

You shouldn’t run it in a Python interpreter. You should run the command in the terminal. See PyCharm docs to learn how to open a terminal.

Yes, In PyCharm I did use the terminal, as shown in the figure. But it reported errors.

You can first run:

python --version

If Python is on your path, you will get a message indicating the version of your Python installation. Then, you can run:

python -m pip install gamspy

If not, see this to learn how to install Python on your computer and add Python to your path. Once you do that, you can repeat the steps above.

Thanks, Muhammet, I made some progress by following your instructions, but still encountered errors. Please see the figure below.

Can you run the same command again? At the time you wrote, one of GAMSPy’s dependencies was not supporting Python 3.13 out of the box but it is updated now and it should work fine when you run pip install gamspy.

Thanks a lot, Muhammet. I ran pip install gamspy again, and this time gamspy was installed successfully.

1 Like