I have to run a python script with WebIOPi which include telepot for telegram bot. The problem is that I can only use telepot with Python2.7 but WebIOPi uses Python 3.4. How can I solve the problem?
Asked
Active
Viewed 1,038 times
2 Answers
0
Try this -
Step 3: Install WebIOPi using Python 2.7
By default, WebIOPi installs itself using Python 3. Unfortunately Python 3 is not widely adopted and many developers prefer to work in Python 2.7--The driver we will be using for the DHT11 requires Python 2.7.
Installing WebIOPi using Python 2.7 is easy, we just have to remove " python3" from the fourth line setup.sh:
$ wget WebIOPi-x.y.z.tar.gz
$ tar xvzf WebIOPi-x.y.z.tar.gz
$ cd WebIOPi-x.y.z
$ sed -i 's/ python3//' setup.sh
$ sudo ./setup.sh
$ sudo webiopi-passwd
$ sudo service webiopi restart

Eric
- 1
0
I solved the problem just replacing python3 with python2.7 on setup.sh file. My case I used webiopi-0.7.1
wget WebIOPi-x.y.z.tar.gz
$ tar xvzf WebIOPi-x.y.z.tar.gz
$ cd WebIOPi-x.y.z
$ sed -i 's/ python3/python2.7/' setup.sh
$ sudo ./setup.sh
$ sudo service webiopi restart

Amir
- 8,821
- 7
- 44
- 48