Page 1 of 1

Python 3.7

Posted: Mon Jan 13, 2020 12:13 pm
by Renger
Hi
I am setting up my new laptop. I have the following questions with regard to Gams-Python (Gams 30'Beta):
  • When I try to install the Python 3.7 with "python setup.py install", in the API3.7 directory, I get the error message "Fatal error: Trying to install GAMS Python API 3.7 using Python.
  • I have tried to run my external python version with Gams, but although I played around with the code described in one of the examples (but not in the documentation), I didn't manage to get Gams-Python running. I checked for the GMSPYTHONHOME, but I couldn't find it in my WIndows settings. So it looks like that it was not automatically generated.
    $if not setEnv GMSPYTHONHOME
    $if %gams.pySetup%==1 $abort.noError Embedded code Python not ready to be used
    $if not setEnv GMSPYTHONHOME $log --- Using external Python
    [/code]
  • How can I easily get Gams to work with my external Python (I tried the tricks described in a previous post from me, but they didn't work).
Cheers
Renger

Re: Python 3.7

Posted: Mon Jan 13, 2020 1:41 pm
by Clemens
Renger,

First of all we need to distinguish between the use of the GAMS Python API and the GAMS Embedded Code Facility . While the GAMS Python API is provided for different version of Python, the Embedded Code Facility requires a Python 3.6 right now.

The error message comes from the setup.py script itself and should actually contain the Python version that you try to use for the installation. I wonder why this is missing in your error. I was for instance able to generate the following error trying to install the GAMS Python API 3.7 using a Python 3.8 interpreter:

Code: Select all

Fatal Error: Trying to install GAMS Python API 3.7 using Python 3.8
If you want to skip the version check, run the setup.py script specifying '-noCheck'
Best,
Clemens