readthedocs "virtualenv: error: unrecognized arguments" during update_repos.

问题描述 投票:0回答:1

我在本地安装了一个readthedocs,地址是 /readthedocs.org 在Debian buster容器上安装了Python 3.6。Python 3.6 和 pip 需求一起安装 (包括 virtualenv)。我在 readthedocs (Openwhisk) 上添加了一个单一的仓库,基本配置如下。

# In .readthedocs.yml
mkdocs:
  configuration: mkdocs.yml

python:
  version: 3.6
  system_packages: true


# In mkdocs.yml
site_name: Openwhisk

当我运行 python3.6 manage.py update_repos 我得到以下错误。

[27/May/2020 19:00:01] readthedocs.doc_builder.environments:146[4964]: INFO Running: 'python3.6 -mvirtualenv  /readthedocs.org/user_builds/openwhisk/envs/latest' [$HOME]
[27/May/2020 19:00:01] readthedocs.doc_builder.environments:294[4964]: DEBUG Post response via JSON encoded data: {'id': 41, 'run_time': 0, 'command': 'python3.6 -mvirtualenv  /readthedocs.org/user_builds/openwhisk/envs/latest', 'description': '', 'output': 'usage: virtualenv [--version] [--with-traceback] [-v | -q] [--app-data APP_DATA] [--clear-app-data] [--discovery {builtin}] [-p py] [--creator {builtin,cpython3-posix,venv}] [--seeder {app-data,pip}] [--no-seed]\n                  [--activators comma_sep_list] [--clear] [--system-site-packages] [--symlinks | --copies] [--download | --no-download] [--extra-search-dir d [d ...]] [--pip version] [--setuptools version] [--wheel version] [--no-pip]\n                  [--no-setuptools] [--no-wheel] [--symlink-app-data] [--prompt prompt] [-h]\n                  dest\nvirtualenv: error: unrecognized arguments: /readthedocs.org/user_builds/openwhisk/envs/latest', 'exit_code': 2, 'start_time': '2020-05-27T19:00:01.078364Z', 'end_time': '2020-05-27T19:00:01.326186Z', 'build': 7}
[27/May/2020 19:00:01] readthedocs.vcs_support.utils:129[4964]: DEBUG Lock (openwhisk): Releasing
[27/May/2020 19:00:01] readthedocs.doc_builder.environments:625[4964]: WARNING (Build) [openwhisk:latest] Command python3.6 -mvirtualenv  /readthedocs.org/user_builds/openwhisk/envs/latest failed:
usage: virtualenv [--version] [--with-traceback] [-v | -q] [--app-data APP_DATA] [--clear-app-data] [--discovery {builtin}] [-p py] [--creator {builtin,cpython3-posix,venv}] [--seeder {app-data,pip}] [--no-seed]
                  [--activators comma_sep_list] [--clear] [--system-site-packages] [--symlinks | --copies] [--download | --no-download] [--extra-search-dir d [d ...]] [--pip version] [--setuptools version] [--wheel version] [--no-pip]
                  [--no-setuptools] [--no-wheel] [--symlink-app-data] [--prompt prompt] [-h]
                  dest
virtualenv: error: unrecognized arguments: /readthedocs.org/user_builds/openwhisk/envs/latest
Traceback (most recent call last):
  File "/readthedocs.org/readthedocs/projects/tasks.py", line 763, in run_build
    self.setup_python_environment()
  File "/readthedocs.org/readthedocs/projects/tasks.py", line 1139, in setup_python_environment
    self.python_env.setup_base()
  File "/readthedocs.org/readthedocs/doc_builder/python_environments.py", line 314, in setup_base
    cwd='$HOME',
  File "/readthedocs.org/readthedocs/doc_builder/environments.py", line 638, in run
    return super().run(*cmd, **kwargs)
  File "/readthedocs.org/readthedocs/doc_builder/environments.py", line 420, in run
    return self.run_command_class(cls=self.command_class, cmd=cmd, **kwargs)
  File "/readthedocs.org/readthedocs/doc_builder/environments.py", line 644, in run_command_class
    return super().run_command_class(*cmd, **kwargs)
  File "/readthedocs.org/readthedocs/doc_builder/environments.py", line 492, in run_command_class
    raise BuildEnvironmentWarning(msg)
readthedocs.doc_builder.exceptions.BuildEnvironmentWarning: Command python3.6 -mvirtualenv  /readthedocs.org/user_builds/openwhisk/envs/latest failed:
usage: virtualenv [--version] [--with-traceback] [-v | -q] [--app-data APP_DATA] [--clear-app-data] [--discovery {builtin}] [-p py] [--creator {builtin,cpython3-posix,venv}] [--seeder {app-data,pip}] [--no-seed]
                  [--activators comma_sep_list] [--clear] [--system-site-packages] [--symlinks | --copies] [--download | --no-download] [--extra-search-dir d [d ...]] [--pip version] [--setuptools version] [--wheel version] [--no-pip]
                  [--no-setuptools] [--no-wheel] [--symlink-app-data] [--prompt prompt] [-h]
                  dest
virtualenv: error: unrecognized arguments: /readthedocs.org/user_builds/openwhisk/envs/latest

[27/May/2020 19:00:01] readthedocs.doc_builder.environments:581[4964]: INFO (Build) [openwhisk:latest] Build finished
[27/May/2020 19:00:01] celery.app.trace:124[4964]: INFO Task readthedocs.projects.tasks.send_notifications[508c1b76-28bf-4c97-9afd-5824295c378f] succeeded in 0.007888936903327703s: None
[27/May/2020 19:00:01] readthedocs.projects.tasks:1450[4964]: INFO Skipping build files deletetion for version: 1
[27/May/2020 19:00:01] celery.app.trace:124[4964]: INFO Task readthedocs.projects.tasks.update_docs_task[bf8e5976-c70a-47b8-bf9c-69a31fbd9c24] succeeded in 4.51686664391309s: True

奇怪的是,当我在CLI上运行完全相同的命令时,它却能正常工作。

root@38e93376269d:/readthedocs.org# python3.6 -mvirtualenv  /readthedocs.org/user_builds/openwhisk/envs/latest
created virtual environment CPython3.6.10.final.0-64 in 274ms
  creator CPython3Posix(dest=/readthedocs.org/user_builds/openwhisk/envs/latest, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/root/.local/share/virtualenv/seed-app-data/v1.0.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

有什么建议吗?

virtualenv read-the-docs
1个回答
0
投票

回答我自己的问题。readthedocs 5.1 (可能还有更老的版本)目前有一个bug,在这个bug中,拥有 use_system_site_packages 设为 false.readthedocs.yml 会给出这个错误。

要解决这个问题,请在 .readthedocs.yml:

python:
  use_system_site_packages: true
© www.soinside.com 2019 - 2024. All rights reserved.