opsdroid: Opsdroid fails to start on windows if installed with anaconda

Description

This issue was raised by @sbeesm on issue #477 - He is unable to run opsdroid when installed with anaconda present in the system.

On an - probably not related - note I’ve also had issues with anaconda any my python3 install so maybe this could be an issue with conda?

Steps to Reproduce

Install anaconda on a windows machine. Try to run opsdroid.

Expected Functionality

Opsdroid runs.

Experienced Functionality

Opsdroid runs.

PR #382 fixes #353 and adds windows support but I still get this error when I try to run opsdroid in windows:

> (C:\Anaconda3) C:\Users\HP>opsdroid
INFO opsdroid: ========================================
INFO opsdroid: Started application
INFO opsdroid: ========================================
INFO opsdroid: You can customise your opsdroid by modifying your configuration.yaml
INFO opsdroid: Read more at: http://opsdroid.readthedocs.io/#configuration
INFO opsdroid: Watch the Get Started Videos at: http://bit.ly/2fnC0Fh
INFO opsdroid: Install Opsdroid Desktop at:
https://github.com/opsdroid/opsdroid-desktop/releases
INFO opsdroid: ========================================
WARNING opsdroid.loader: No databases in configuration.This will cause skills which store things inmemory to lose data when opsdroid is restarted.
INFO opsdroid.loader: Cloning hello from remote repository
Traceback (most recent call last):
  File "c:\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Anaconda3\Scripts\opsdroid.exe\__main__.py", line 9, in <module>
  File "c:\anaconda3\lib\site-packages\opsdroid\__main__.py", line 130, in main
    opsdroid.start_loop()
  File "c:\anaconda3\lib\site-packages\opsdroid\core.py", line 136, in start_loop
    self.loader.load_modules_from_config(self.config)
  File "c:\anaconda3\lib\site-packages\opsdroid\loader.py", line 257, in load_modules_from_config
    skills = self._load_modules('skill', config['skills'])
  File "c:\anaconda3\lib\site-packages\opsdroid\loader.py", line 307, in _load_modules
    self._install_module(config)
  File "c:\anaconda3\lib\site-packages\opsdroid\loader.py", line 336, in _install_module
    self._install_git_module(config)
  File "c:\anaconda3\lib\site-packages\opsdroid\loader.py", line 386, in _install_git_module
    config["branch"])
  File "c:\anaconda3\lib\site-packages\opsdroid\loader.py", line 98, in git_clone
    stderr=subprocess.PIPE)
  File "c:\anaconda3\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "c:\anaconda3\lib\subprocess.py", line 997, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
> 
I have installed it using pip3 in anaconda in my default python 3.6 environment.

Versions

  • Opsdroid version: dev
  • Python version: 3.6
  • OS/Docker version: Windows

Configuration File

Please include your version of the configuration file bellow.

# Your code goes here.

Additional Details

Any other details you wish to include such as screenshots, console messages, etc.

@sbeesm What windows version are you using? And would you like to add anything else to this report? 😃

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (24 by maintainers)

Most upvoted comments

I’m happy to see that my quick fix seem to work (kind off), when I was looking at your traceback I was worried that you would have issues running opsdroid due to how the filepath is build in the opsdroid.loader.

This line: PermissionError: [WinError 5] Access is denied: 'C:\\Users\\HP/.opsdroid\\modules\\opsdroid-modules\\connector\\shell\\.git\\objects

Just made me sure that the issue exists also in the loader file(notice the wrong / used).

As soon as I get home I’ll try to fix this issue by using the os.path.join method on the methods that join paths. This should fix the issue fully. Anyhow I’m happy that you can now use opsdroid in your windows system.

Please let me know if you encounter any further issues with it and if you need help with anything else 😀👍

Yes I think that’s the problem. When opsdroid installs modules it needs to be able to run git from the command prompt.

I have two thoughts here:

  • We should wrap this error in a better error message.
  • Should we add a config option to allow you to point opsdroid to a git binary?