I’m having trouble with the install of the Python api.
I ran setup.py install from an elevated prompt without errors, but when I try to run transport.py from my IDE (VSCode) it rises the following exception: ModuleNotFoundError, No module named ‘workspace’
What can be wrong ?
Best regards!
Examining workspace.pyd with dependency walker show a link failure to c:\gams\win64\24.2\PYTHON27.DLL. Can this be related to the problem, since I’m trying to call it from python 3 ? Inside the link it show failures at several windows libraries and MSVCR90.
The GAMS Python API comes in separate directories for different versions of Python. Please have a look at the ‘Getting Started’ section of the tutorial and make sure that you install the correct files for your version of Python:
https://www.gams.com/latest/docs/apis/examples_python/index.html
Best,
Clemens
From “Getting Started”
Examples using the API are located in apifiles/Python while the API itself is found in apifiles/Python/api for Python 2.7, in apifiles/Python/api_26 for Python 2.6 (Windows and Linux only), in apifiles/Python/api_34 for Python 3.4 and in apifiles/Python/api_36 for Python 3.6.
I don’t have that many folders in GAMS 24.2.3, I only have apifiles\Python\api and apifiles\Python\api_26. I ran setup.py from apifiles\Python\api since my Python version is 3.6
I read this over, sorry. Support for Python 3.6 was added recently in GAMS 24.8.4. If you ran the setup script from the directory ‘api’, you have installed the Python 2.7 version which is not compatible with Python 3.6
Best,
Clemens
Ok, so two other questions:
- How can I correctly uninstall the API ?
- When I have Py 2.7 and 3.6 coexisting on the same machine, is there any extra step needed to make sure the API installs properly for 2.7 ?
Seems to be working perfectly. Thank you Clemens!