Error while opening port in Python using TI Chronos

前端 未结 6 1210
野趣味
野趣味 2021-01-05 17:46

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:\         


        
相关标签:
6条回答
  • 2021-01-05 18:13

    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)

    0 讨论(0)
  • 2021-01-05 18:24

    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.

    0 讨论(0)
  • 2021-01-05 18:26

    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.

    0 讨论(0)
  • 2021-01-05 18:32

    I figured it out. It was simple enough.

    I just disabled the COM port in the Device Manager window and enabled it again.

    0 讨论(0)
  • 2021-01-05 18:37

    Sometimes a port gets blocked.

    Try restarting system. It worked for me.

    0 讨论(0)
  • 2021-01-05 18:39

    Running python from cmd as administrator also works for me.

    To run:

    1. Type cmd in search

    2. Right-click and select run as administrator

    0 讨论(0)
提交回复
热议问题