depot_tools конфликт между python 2 и 3 - PullRequest
1 голос
/ 28 апреля 2020

Я видел вариации этой ошибки, но нет разрешения.

Установка depot_tools в папке Desktop, Lubuntu 18.04.

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

разрешается (по-видимому) отлично; мод PATH в порядке, нет ~, абсолютный путь.

$python -V = 2.7.17

/ usr / lib также содержит python3, python3 .6, python 3.7 и python 3.8

Вызывает gclient syn c или извлекает return:

/home/arctos/Desktop/stream/depot_tools/bootstrap_python3: line 32: bootstrap-3.8.0.chromium.8_bin/python3/bin/python3: No such file or directory
/home/arctos/Desktop/stream/depot_tools/bootstrap_python3: line 32: bootstrap-3.8.0.chromium.8_bin/python3/bin/python3: No such file or directory
cat: /home/arctos/Desktop/stream/depot_tools/python3_bin_reldir.txt: No such file or directory
/home/arctos/Desktop/stream/depot_tools/vpython3: line 52: /home/arctos/Desktop/stream/depot_tools/.cipd_bin/vpython3: No such file or directory

Изучение bootstrap_ python3 показывает:

  BOOTSTRAP_PATH="bootstrap-${PYTHON3_VERSION}_bin"

  # Install CIPD packages. The CIPD client self-bootstraps.
  "cipd" ensure -log-level warning -ensure-file "${CIPD_MANIFEST}" \
      -root "$BOOTSTRAP_PATH"

  BOOTSTRAP_PYTHON_BIN="${BOOTSTRAP_PATH}/python3/bin/python3"
  "$BOOTSTRAP_PYTHON_BIN" "bootstrap/bootstrap.py" --bootstrap-name "$BOOTSTRAP_PATH"

, поэтому кажется, что где-то возникает конфликт, пытающийся установите BOOTSTRAP_PATH, который включает в себя {PYTHON3_VERSION}. GCLIENT.PY содержит

# Warn when executing this script with Python 3 when the GCLIENT_PY3 environment
# variable is not set to 1.
# It is an increasingly common error on Windows 10 due to the store version of
# Python.
if (sys.version_info.major >= 3
    and not 'GCLIENT_TEST' in os.environ
    and os.getenv('GCLIENT_PY3') != '1'):
  print('Warning: Running gclient on Python 3. \n'
        'If you encounter any issues, please file a bug on crbug.com under '
        'the Infra>SDK component.', file=sys.stderr)

Теперь sys.version_info.major показывает Python 2.7.17, НЕ Python 3. Этот конфликт может быть коренится в GCLIENT_SMOKETEST_BASE.PY, который содержит

class GClientSmokeBase(fake_repos.FakeReposTestBase):
  def setUp(self):
    super(GClientSmokeBase, self).setUp()
    # Make sure it doesn't try to auto update when testing!
    self.env = os.environ.copy()
    self.env['DEPOT_TOOLS_UPDATE'] = '0'
    self.env['DEPOT_TOOLS_METRICS'] = '0'
    # Suppress Python 3 warnings and other test undesirables.
    self.env['GCLIENT_TEST'] = '1'
    self.env['GCLIENT_PY3'] = '0' if sys.version_info.major == 2 else '1'
    self.maxDiff = None

но я не могу определить правильное исправление для этого, которое позволит depot_tools правильно установить / запустить.

Также ничего не стоит, что это новая ошибка; установка две недели go были в порядке.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...