Fixing Orange Canvas on Windows 7+

Several users have reported that Orange Canvas has ceased to function properly on their version of Windows (7 or later). The symptom can hardly be overlooked: nothing happens when trying to launch the application.

In at least some of these cases, the problem can be fixed by taking the following steps:

  1. Locate the directory where Orange Canvas has been installed. This will usually be something like C:\Python27\Lib\site-packages\Orange.
  2. From this directory, further navigate to the OrangeCanvas\application directory and open the file named canvasmain.py (not .pyc) in a raw text editor like Notepad (or better yet, your favorite code editor).
  3. In this file, locate the function Restore() and, whithin this function (around line 723 in the current version of it), the following 3 lines:
            if not os.path.exists(self.last_scheme_dir):
                # if directory no longer exists reset the saved location.
                self.last_scheme_dir = default_dir
    
  4. Replace them (exactly) with the following 5 lines (including leading spaces):
            try:
                if not os.path.exists(self.last_scheme_dir):
                # if directory no longer exists reset the saved location.
                    self.last_scheme_dir = default_dir
            except UnicodeEncodeError: 
                self.last_scheme_dir = default_dir
    

Leave a Reply

Your email address will not be published. Required fields are marked *