Desktop and Enterprise Software, Solutions and Services for Chemists and Biologists.

Enterprise Support » FAQ


Question:

IronPython.Runtime.Exceptions.ImportException: No module named os.path

 

Answer:


Trying to import the os.path Python module in Spotfire fails with the error -IronPython.Runtime.Exceptions.ImportException: No module named os.path The OS module is not seem a part of the Spotfire Python module so it fails to load and cannot be used in the Spotfire Python scripts.

Resolution

The .NET module System.IO can be used for any file related operations. For example, to check if a file exists in a directory, use the following snippet:

from System.IO import File

path = r'c:\temp\myfile.txt'

print 'File Exists: %s' % File.Exists(path)



Created on: 7/13/2017
<< Back << Return to support home