Start a new topic

Import Random Error in Suite13 Creator Script.

Original Post by: Fri May 6 08:07:50 2016


Hi,


import random


class indent:

pass


def PrintNodeSelectPre (db, parent, rec, i):

if (mgGetCode(rec) == fltPolygon):

attList = mgGetAttList(rec, fltPolyTexmap)

max=5

if (attList != -1):

tmp=random.randint(1,max)

x=30*tmp

print "Material id =",tmp

mgSetAttList (rec, fltPolyMaterial, tmp)

mgSetPolyColorRGB(rec,255, 255, x)

return MG_TRUE


Its returning error : E: ImportError: No module named random


print sys.path shows -> ['C:\\Presagis\\Suite13\\Creator\\bin', 'C:\\Program Files (x86)\\ArcGIS\\bin', 'C:\\Presagis\\Suite13\\Creator\\bin\\python27.zip', '', 'C:\\Presagis\\Suite13\\Creator\\bin']


Anyway to solve this? i reinstalled Python2.7. And i'm not able to locate "python27.zip" as mentioned in above path.

1 Comment

Original Post by: SteveThompson Fri May 6 16:43:14 2016


Sounds like your Python installation may not have set things up correctly for you on your system.


Can you check the value of the environment variable PYTHONPATH? It should include the lib folder of the Python installation. BTW, the PATH environment variable is not used by Python to locate modules. It is PYTHONPATH that is the important env var.


Let us know what you find out.


BTW, are you running inside or outside of Creator?

Login to post a comment