I\'m trying to get accelerometer data from TI Chronos. I get the following error message when I run the code:
Traceback (most recent call last):
File \"C:\
Another situation that also creates the Access Denied error:
The port permissions are actually set to deny normal user access! Some system administrators lock down ports for good reasons, so only users with administrator privileges can get access.
The simplest work-around is to run cmd.exe as administrator. See Run a Command as Administrator from the Run Box in Windows 7, 8, or 10
Summary: Win + R, "cmd", Shift + Ctrl + Enter
"It Works For Me!" (tm)
I was having a similar error today in Jupyter Notebook and managed to solve it by opening Jupyter Notebook through Anaconda Navigator instead of opening it through Anaconda Prompt.
The most common source of such errors is the port being already opened by some other application, or frequently by a previous (executed, but forgotten to kill) instance of your code.
To test this hypothesis, the easiest way is to run some other program that opens the same port (for example, HyperTerminal) when you're getting the error. If it fails also, try to find who's holding the port.
Also, Portmon is a useful tool in debugging similar problems with the serial port.
I figured it out. It was simple enough.
I just disabled the COM port in the Device Manager window and enabled it again.
Sometimes a port gets blocked.
Try restarting system. It worked for me.
Running python
from cmd as administrator also works for me.
To run:
Type cmd in search
Right-click and select run as administrator