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 #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from os import environ, chdir from os import environ, chdir
import platform
import subprocess import subprocess
import sys import sys
import logging
from shutil import which
try: # noqa try: # noqa
chdir(sys.path[0]) # noqa chdir(sys.path[0]) # 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 subprocess.call(('pip', 'install', '-r', 'requirements.txt')) # noqa
except Exception: # noqa except Exception as e: # noqa
pass # hope it works # 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 from agent.agent import init_serial, reactor
# Note: Import everything because later we need to use the BaseContext # Note: Import everything because later we need to use the BaseContext
# (relative import error. # (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