kushalkolar / MESmerize

Platform for Calcium Imaging analysis. DEPRECATED.
GNU General Public License v3.0
58 stars 14 forks source link

HOME environment variable is not set on some Windows machines #42

Closed kushalkolar closed 2 years ago

kushalkolar commented 3 years ago

For whatever reason, some (not all) Windows machines don't have the HOME env variable set by default. Perhaps find a more reliable way to get the user's dir on Windows.

  File "c:\users\nadtochi\anaconda\envs\try_me\lib\site-packages\mesmerize\viewer\main_window.py", line 137, in <lambda>
    self.ui.actionScript_Editor.triggered.connect(lambda: self.run_module(script_editor.ModuleGUI))
  File "c:\users\nadtochi\anaconda\envs\try_me\lib\site-packages\mesmerize\viewer\main_window.py", line 279, in run_module
    m = module_class(self, self._viewer)
  File "c:\users\nadtochi\anaconda\envs\try_me\lib\site-packages\mesmerize\viewer\modules\script_editor.py", line 27, in __init__
    self.open_temp_script()
  File "c:\users\nadtochi\anaconda\envs\try_me\lib\site-packages\mesmerize\viewer\modules\script_editor.py", line 72, in open_temp_script
    home_dir = os.environ['HOME']
  File "c:\users\nadtochi\anaconda\envs\try_me\lib\os.py", line 669, in __getitem__
    raise KeyError(key) from None
KeyError: 'HOME'
pr4deepr commented 3 years ago

I had this issue on my Windows computer and added this in the System configuration:

set HOME=%USERPROFILE%

Seemed to fix it.

kushalkolar commented 2 years ago

So apparently mesmerize.config uses the right env variable if the os is windows but the script editor doesn't call config, need to fix line 73

kushalkolar commented 2 years ago

I had this issue on my Windows computer and added this in the System configuration:

set HOME=%USERPROFILE%

Seemed to fix it.

Could you elaborate on where you had this issue if you remember? Was it the script editor?

pr4deepr commented 2 years ago

Yes, it was the script editor

kushalkolar commented 2 years ago

thanks! this was recently fixed in master

On Wed, Mar 9, 2022 at 12:37 PM Pradeep Rajasekhar @.***> wrote:

Yes, it was the script editor

— Reply to this email directly, view it on GitHub https://github.com/kushalkolar/MESmerize/issues/42#issuecomment-1063184479, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACHXXRGIYKNTSY455YHAIBLU7DOWPANCNFSM4UMKEHYQ . You are receiving this because you authored the thread.Message ID: @.***>