Commit 2fe1567b by carpoon

try to call python3 pip

if there is a pip3 binary call that instead of pip, to better support platforms with bot python 2 and 3
parent 382cea4d
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import environ, chdir
import platform
import subprocess
import sys
import logging
from shutil import which
try: # noqa
chdir(sys.path[0]) # noqa
subprocess.call(('pip', 'install', '-r', 'requirements.txt')) # noqa
except Exception: # noqa
pip3_available = which("pip3")
if pip3_available is not None:
subprocess.call(('pip3', 'install', '-r', 'requirements.txt')) # noqa
else:
subprocess.call(('pip', 'install', '-r', 'requirements.txt')) # noqa
except Exception as e: # noqa
pass # hope it works # noqa
from twisted.internet import reactor, defer
from twisted.internet.task import LoopingCall
import uptime
import logging
from inspect import getfullargspec, isfunction
from agent.SerialLineReceiverBase import SerialLineReceiverBase
from agent.agent import init_serial, reactor
# Note: Import everything because later we need to use the BaseContext
# (relative import error.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment