mdenil

script  running from the desktop cannot find arcpy

Discussion created by mdenil on Nov 5, 2012
Latest reply on Nov 7, 2012 by mdenil
I have a script I run occasionally from the desktop by double clicking.
..or at least I did, before upgrading from 10.0 (2.6) to 10.1 (2.7).
Now, it fails trying to import arcpy.

I knocked up a test script that displays the same problem.
It runs from IDLE, and from the command line,
but cannot load arcpy when run from the desktop.
print "   qwertyuiopnqwertyuiopnasdfghjkl"
sepuku = raw_input('enter')
try:
    print 'os'
    import os
except:
    sepuku = raw_input('no os ->')
try:
    print 'sys'
    import sys
except:
    sepuku = raw_input('no sys ->')
try:
    print 'datetime'
    import datetime
except:
    sepuku = raw_input('no datetime ->')
try:
    import arcpy
except:
    sepuku = raw_input('no arcpy ->')
sepuku = raw_input('all done ->')


Run from the desktop, it always reports: no arcpy
Run from a command line, it imports fine.

Outcomes