There is no “aspose.cad” to import in Python anymore. I had it in an older version, in Windows. However I am running Ubuntu now and just pip installed the latest version of aspose-cad. My original script had an import statement - “import aspose.cad as cad”, but that doesn’t work now.
What has changed?
>>> import aspose
>>> dir(aspose)
['AsposeModuleFinder', 'AsposeModuleLoader', 'SourceFileLoader', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_load', '_platform_suffixes', 'foreach_file', 'im', 'inspect', 'os', 're', 'sys', 'sysconfig', 'util']
>>> dir(aspose.AsposeModuleLoader)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_import_file', '_load_native_module', '_prepare_as_package', '_register_additional_classes', 'aspose_native_lib_dir', 'aspose_py_modules', 'load_module']
>>> import aspose
>>> dir(aspose.util)
['LazyLoader', 'Loader', 'MAGIC_NUMBER', '_LazyModule', '_RAW_MAGIC_NUMBER', '__builtins__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_find_spec', '_find_spec_from_path', '_imp', '_incompatible_extension_module_restrictions', '_resolve_name', 'cache_from_source', 'decode_source', 'find_spec', 'module_from_spec', 'resolve_name', 'source_from_cache', 'source_hash', 'spec_from_file_location', 'spec_from_loader', 'sys', 'threading', 'types']
>>>
>>>
>>>
>>>
>>> import aspose-cad
File "<stdin>", line 1
import aspose-cad
^
SyntaxError: invalid syntax
>>> import aspose.cad
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'aspose.cad'
>>>