Issue:
Python Script will not run because sshtunnel import to Python 3 does not seem import properly to the Pi.
I am thinking we are using the wrong version of ssh module python script for the Pi but I am struggling.
Hardware :
Raspberry Pi 3 Model B - V 1.2 2015
OS Software :
pi@raspberrypi:~ $ cat /etc/*-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
Script:
import sshtunnel #import SSHTunnelForwarder
import mysql.connector
ID_String_Last = ["0"]
sshtunnel.SSH_TIMEOUT = 5.0
sshtunnel.TUNNEL_TIMEOUT = 5.0
with sshtunnel.SSHTunnelForwarder(
('**********this is the host in here **********'),
ssh_username='', ssh_password='**********************',
remote_bind_address=('127.0.0.1,', 3306)
) as tunnel:
connection = mysql.connector.connect(
user='*********username**********', password='*****************',
host='127.0.0.1', port=tunnel.local_bind_port,
database='northgm7_489.log_1001',
)
Output:
Python 3.4.2 (/usr/bin/python3)
>>> %Run '17-10- 15 V6.1 Pi mySQL to Ash server.py'
Traceback (most recent call last):
File "/home/pi/Desktop/17-10- 15 V6.1 Pi mySQL to Ash server.py", line 3, in <module>
import sshtunnel #import SSHTunnelForwarder
ImportError: No module named 'sshtunnel'
Question:
Does anybody know what version of module is required for this platform so that it can run?
Our community of experts have been thoroughly vetted for their expertise and industry experience.