import os
import sys
import ctypes
import platform

if platform.system() == 'Windows':
    lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
    lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
    from glob import glob
    try:
        if ctypes.sizeof(ctypes.c_voidp) == 4:
            dllfile = glob(lib32 + '/*.dll')[0]
        else:
            dllfile = glob(lib64 + '/*.dll')[0]
        ctypes.CDLL(dllfile)
    except:
        pass

sys.path.append(os.path.join(os.path.dirname(__file__), 'cppinterface'))
from amplpython import *
from amplpython import _READTABLE, _WRITETABLE

import os
import sys
import ctypes
import platform

if platform.system() == 'Windows':
    lib32 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib32')
    lib64 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib64')
    from glob import glob
    try:
        if ctypes.sizeof(ctypes.c_voidp) == 4:
            dllfile = glob(lib32 + '/*.dll')[0]
        else:
            dllfile = glob(lib64 + '/*.dll')[0]
        ctypes.CDLL(dllfile)
    except:
        pass

sys.path.append(os.path.join(os.path.dirname(__file__), 'cppinterface'))
from amplpython import *
from amplpython import _READTABLE, _WRITETABLE

Fix 'ImportError: DLL load failed'
Fix 'ImportError: DLL load failed'

  import os
  import sys
  import ctypes
  import platform
  
  if platform.system() == 'Windows':
-     lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
+     lib32 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib32')
-     lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
+     lib64 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib64')
      from glob import glob
      try:
          if ctypes.sizeof(ctypes.c_voidp) == 4:
              dllfile = glob(lib32 + '/*.dll')[0]
          else:
              dllfile = glob(lib64 + '/*.dll')[0]
          ctypes.CDLL(dllfile)
      except:
          pass
  
  sys.path.append(os.path.join(os.path.dirname(__file__), 'cppinterface'))
  from amplpython import *
  from amplpython import _READTABLE, _WRITETABLE
  
Fix 'ImportError: DLL load failed'
## Code Before:
import os
import sys
import ctypes
import platform

if platform.system() == 'Windows':
    lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
    lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
    from glob import glob
    try:
        if ctypes.sizeof(ctypes.c_voidp) == 4:
            dllfile = glob(lib32 + '/*.dll')[0]
        else:
            dllfile = glob(lib64 + '/*.dll')[0]
        ctypes.CDLL(dllfile)
    except:
        pass

sys.path.append(os.path.join(os.path.dirname(__file__), 'cppinterface'))
from amplpython import *
from amplpython import _READTABLE, _WRITETABLE

## Instruction:
Fix 'ImportError: DLL load failed'
## Code After:
import os
import sys
import ctypes
import platform

if platform.system() == 'Windows':
    lib32 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib32')
    lib64 = os.path.join(os.path.dirname(__file__), 'cppinterface', 'lib64')
    from glob import glob
    try:
        if ctypes.sizeof(ctypes.c_voidp) == 4:
            dllfile = glob(lib32 + '/*.dll')[0]
        else:
            dllfile = glob(lib64 + '/*.dll')[0]
        ctypes.CDLL(dllfile)
    except:
        pass

sys.path.append(os.path.join(os.path.dirname(__file__), 'cppinterface'))
from amplpython import *
from amplpython import _READTABLE, _WRITETABLE
