Skip to content

Cannot install scalyr-agent-2 on Ubuntu with Python2 and Python3 installed #1217

@stormentt

Description

@stormentt

596cab27 introduced two imports for ThreadPoolExecutor from concurrent.futures, which was introduced in python 3.2.

agent_build_refactored/managed_packages/non-aio/install-scriptlets/check-python.sh can set the python interpreter to python 2.7 if it's installed on the system, which causes the package install to fail:

. Trying to switch the Python interpreter for the Scalyr Agent.
 . Searching for python in PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin":
 + command python [2.7.17] is found and matches the minimum required version - Success!
 + The Scalyr Agent will use the default system python binary (/usr/bin/env python).
 Traceback (most recent call last):
   File "/usr/share/scalyr-agent-2/bin/scalyr-agent-2", line 101, in <module>
     from scalyr_agent.monitors_manager import MonitorsManager
   File "/usr/share/scalyr-agent-2/py/scalyr_agent/monitors_manager.py", line 20, in <module>
     from scalyr_agent.builtin_monitors.thread_pool import ThreadPoolExecutorFactory
   File "/usr/share/scalyr-agent-2/py/scalyr_agent/builtin_monitors/thread_pool.py", line 20, in <module>
     from concurrent.futures import ThreadPoolExecutor
 ImportError: No module named concurrent.futures
 Traceback (most recent call last):
   File "/usr/sbin/scalyr-agent-2", line 101, in <module>
     from scalyr_agent.monitors_manager import MonitorsManager
   File "/usr/share/scalyr-agent-2/py/scalyr_agent/monitors_manager.py", line 20, in <module>
     from scalyr_agent.builtin_monitors.thread_pool import ThreadPoolExecutorFactory
   File "/usr/share/scalyr-agent-2/py/scalyr_agent/builtin_monitors/thread_pool.py", line 20, in <module>
     from concurrent.futures import ThreadPoolExecutor
 ImportError: No module named concurrent.futures

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions