ANVEL 2.5 Python path issue



  • Hi,
    I'm trying to get through the built-in Python tutorial and followed all the instructions. However, I still can't run any scripts from the Python Console. I've checked the path (sys.path) and made sure it includes the folders that contain my scripts. However, when I try running any of them using the exec() command, I get the "No such file or directory" message:

    sys.path
    ['C:\Program Files\ANVEL25\bin\common\Python\x64\python27.zip', '.', '', 'C:\Users\simulator3\AppData\Local\Anvel\/Scripts/', 'C:\Users\simulator3\AppData\Local\Anvel\/Scripts/AutoGenObjectScripts/', 'C:\Users\simulator3\AppData\Local\Anvel\Scripts', 'C:/Users/simulator3/AppData/Local/Anvel/Scripts', 'C:\Temp']

    exec (open("Hello.py").read())
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    IOError: [Errno 2] No such file or directory: 'Hello.py'

    (Hello.py lives in several of the folders in 'path', including C:\Temp)



  • @rr,

    Thanks for reaching out. This does indeed look like an issue in how we're handling relative paths in the Python console. In the meantime, it appears that specifying the absolute path to the script does work. Try:

    exec(open(r"C:\Path\To\Script\script.py").read())

    Regards,
    ANVEL Support



  • Cool, thanks for checking.


Log in to reply
 

Looks like your connection to ANVEL Forum was lost, please wait while we try to reconnect.