File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,18 +95,25 @@ def __init__(
9595 """
9696 # Attempt to import the MSCL library and add its path.
9797 try :
98- import sys
98+ try :
99+ import mscl
100+ except (ImportError , ModuleNotFoundError ):
101+ # Falling back to old method of appending to sys.path for importing older versions of mscl
102+ import sys
99103
100- sys .path .append ("/usr/share/python3-mscl" )
101-
102- import mscl
104+ legacy_path = "/usr/share/python3-mscl"
105+ if legacy_path not in sys .path :
106+ sys .path .append (legacy_path )
107+ import mscl
103108
104109 self .mscl = mscl
105110 except ImportError :
106111 LOGGER .warning (
107112 "Failed to import mscl. Please install the MSCL library from Lord Microstrain and append the path "
108113 "to the PYTHONPATH or sys.path. Checkout https://github.com/LORD-MicroStrain/MSCL/tree/master "
109114 "and https://lord-microstrain.github.io/MSCL/Documentation/MSCL%20API%20Documentation/index.html"
115+ "If you are using a newer version of MSCL, you may need to add /usr/lib/python3.version/dist-packages \
116+ to PYTHONPATH"
110117 )
111118
112119 if not offline :
You can’t perform that action at this time.
0 commit comments