question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IOError: [Errno 2] No such file or directory: u'COM11'

See original GitHub issue

When I clone the repo and run python lglaf.py, I get the following error:

Traceback (most recent call last):
  File "lglaf.py", line 404, in <module>
    main()
  File "lglaf.py", line 382, in main
    comm = autodetect_device()
  File "lglaf.py", line 314, in autodetect_device
    return FileCommunication(serial_path)
  File "lglaf.py", line 187, in __init__
    self.f = open(file_path, 'r+b')
IOError: [Errno 2] No such file or directory: u'COM11'

I’m running Python 2.7 on Windows 10 x64, with an LG G5 (H830).

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ivanjxcommented, Apr 23, 2019

For me I just changed the FileCommunication ctor from:

def __init__(self, file_path):
        super(FileCommunication, self).__init__()
        if sys.version_info[0] >= 3:
            self.f = open(file_path, 'r+b', buffering=0)
        else:
            self.f = open(file_path, 'r+b')

to:

def __init__(self, file_path):
        super(FileCommunication, self).__init__()
        if sys.version_info[0] >= 3:
            self.f = open('\\\\.\\'+file_path, 'r+b', buffering=0)
        else:
            self.f = open('\\\\.\\'+file_path, 'r+b')
0reactions
kenkitcommented, Mar 1, 2019

Fixed this on https://github.com/steadfasterX/lglaf/pull/9 Tested on windows 64 and python 3

Read more comments on GitHub >

github_iconTop Results From Across the Web

open() gives FileNotFoundError/IOError: Errno 2 No such file ...
Make sure the file exists: use os.listdir() to see the list of files in the current working directory; Make sure you're in the...
Read more >
[Solved] IOError errno 2 no such file or directory - Python Pool
IOError Errno 2 No Such File Or Directory is thrown when an input-output operation fails because the file is not found in the...
Read more >
Python FileNotFoundError: [Errno 2] No such file or directory ...
This error is usually raised when you use the os library. You will see an IOError if you try to read or write...
Read more >
Errno 2 No such file or directory - YouTube
PYTHON : Python open() gives FileNotFoundError/ IOError : Errno 2 No such file or directory [ Gift : Animated Search Engine ...
Read more >
open file in "w" mode: IOError: [Errno 2] No such file or directory
PYTHON : open file in "w" mode: IOError : [ Errno 2 ] No such file or directory [ Gift : Animated Search...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found