I started by creating a new environment in Anaconda, and in a command line entered:
Code: Select all
(gams_py46) C:\Users\myusername>pip install gamsapi[all]==46.4.0
Code: Select all
python -c "import gams; print(f'API OK -- Version {gams.__version__}')"
Code: Select all
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\GAMS\38\apifiles\Python\gams\gams\__init__.py", line 32, in <module>
from .workspace import *
File "C:\GAMS\38\apifiles\Python\gams\gams\workspace.py", line 32, in <module>
from .database import *
File "C:\GAMS\38\apifiles\Python\gams\gams\database.py", line 26, in <module>
from gdxcc import *
ModuleNotFoundError: No module named 'gdxcc'
Code: Select all
(gams_py46) C:\Users\myusername>python -m site
Code: Select all
sys.path = [
'C:\\Users\\myusername',
'C:\\GAMS\\38\\apifiles\\Python\\gams',
'C:\\Users\\myusername\\%PYTHONPATH%',
'C:\\Anaconda3\\envs\\gams_py46\\python311.zip',
'C:\\Anaconda3\\envs\\gams_py46\\DLLs',
'C:\\Anaconda3\\envs\\gams_py46\\Lib',
'C:\\Anaconda3\\envs\\gams_py46',
'C:\\Anaconda3\\envs\\gams_py46\\Lib\\site-packages',
]
USER_BASE: 'C:\\Users\\myusername\\AppData\\Roaming\\Python' (exists)
USER_SITE: 'C:\\Users\\myusername\\AppData\\Roaming\\Python\\Python311\\site-packages' (doesn't exist)
ENABLE_USER_SITE: True
I don't really want to uninstall GAMS 38 as I need to retain that for the working version of the code I want to upgrade. How do I fix this path issue? Thanks!