[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cannot find reference 'bluetoothctl' in 'sh.py' less... (Ctrl+F1)

Dear Python Experts,

As am newbie to python, I am planning to automate BT functionality test
using Bluez "bluetoothctl" utility  by writing python wrapper and robot
framework integrated with Jenkins

I came across the below link:

In the above link, I saw the below code snippet

*from sh import bluetoothctl*
*mac = "AA:BB:CC:DD:EE"*

And firstly I wanted to verify BT functionality with my PC and the
bluetooth device (basically turned on BT option in my phone and trying to
discover my phone as a BT device) And I have installed the below packages
in my ubuntu 18.04 desktop PC
$* pip3 install sh*
Collecting sh
Installing collected packages: sh
Successfully installed sh-1.12.14
*$ pip3 install bluetoothctl*
*Collecting bluetoothctl*
*  Could not find a version that satisfies the requirement bluetoothctl
(from versions: )*
*No matching distribution found for bluetoothctl*
$ *pip3 install pexpect*
Collecting pexpect
    100% |????????????????????????????????| 61kB 1.5MB/s
Collecting ptyprocess>=0.5 (from pexpect)
Installing collected packages: ptyprocess, pexpect
Successfully installed pexpect-4.6.0 ptyprocess-0.6.0

When I try to paste the below code on pycharm and try to point on the word
"bluetoothctl" in the beginning of the line "*from sh import bluetoothctl*"

*from sh import bluetoothctl*

*mac = "your bluetooth mac"*
*bluetoothctl("connect", mac)*

In the pycharm, I see the below error message :

*Cannot find reference 'bluetoothctl' in 'sh.py' less... (Ctrl+F1) *
*Inspection info: This inspection detects names that should resolve but
don't. Due to dynamic dispatch and duck typing, this is possible in a
limited but useful number of cases. Top-level and class-level items are
supported better than instance items.*

Could you please help me to resolve the above issue, like why am I seeing
the above issue it seems to be some importing "bluetoothhctl" module issue
(sorry if my understanding is wrong)

Kindly do the needful
Many Thanks in advance