python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.48k stars 2.27k forks source link

poetry install extremely slow #9688

Closed nicky132 closed 1 month ago

nicky132 commented 1 month ago

Description

[root@localhost label-studio-1.13.1]# poetry install Updating dependencies Resolving dependencies... (4839.8s)

Workarounds

pip install poetry poetry install then

Updating dependencies Resolving dependencies... (4839.8s)

too slow how can i faster that

Poetry Installation Method

pip

Operating System

CentOS Linux release 7.9.2009 (Core)

Poetry Version

[root@localhost label-studio-1.13.1]# poetry --version Poetry version 1.1.15

Poetry Configuration

[root@localhost label-studio-1.13.1]# poetry config --list
cache-dir = "/root/.cache/pypoetry"
experimental.new-installer = true
installer.parallel = true
repositories.default.url = "https://mirrors.aliyun.com/pypi/simple/"
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.path = "{cache-dir}/virtualenvs"  # /root/.cache/pypoetry/virtualenvs

Python Sysconfig

[root@localhost label-studio-1.13.1]# python --version
Python 3.8.10

Example pyproject.toml

[tool.ruff]
# Enable the pycodestyle (`E`) and Pyflakes (`F`) rules by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = [
    # Pyflakes
    "F",
    # Pycodestyle
    "E",
    # isort
    "I001"
]
ignore = [
    "E501",
    "E402", # ignores: Module level import not at top of file.  (isort takes care of this and if not, there is usually a good reason)
]

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Exclude a variety of commonly ignored directories.
exclude = [
    ".bzr",
    ".direnv",
    ".eggs",
    ".git",
    ".git-rewrite",
    ".hg",
    ".mypy_cache",
    ".nox",
    ".pants.d",
    ".pytype",
    ".ruff_cache",
    ".svn",
    ".tox",
    ".venv",
    "__pypackages__",
    "_build",
    "buck-out",
    "build",
    "dist",
    "node_modules",
    "venv",
    "**/migrations/*.py",
]

# Same as Blue.
line-length = 119

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Assume Python 3.8 at a minimum
target-version = "py38"

[tool.ruff.per-file-ignores]
# Ignore deleting imports in __init__.py files as they're actually being used.
"__init__.py" = ["F401"]
"**/settings/label_studio.py" = ["F405"]
"test*.py" = ["F811"]

[tool.blue]

line-length = 119

include = 'label_studio/.*\.py$'

# Exclude a variety of commonly ignored directories, as well as all migrations files.
force-exclude = '''
/(
    \.bzr
  | \.direnv
  | \.eggs
  | \.git
  | \.github
  | \.git-rewrite
  | \.hg
  | \.mypy_cache
  | \.nox
  | \.pants.d
  | \.pytype
  | \.ruff_cache
  | \.svn
  | \.tox
  | \.venv
  | \.hg
  | _build
  | buck-out
  | build
  | dist
  | node_modules
  | migrations
  | venv
  | __pycache__
)/
'''

target-version = ['py38']

[tool.poetry]

name = "label-studio"
version = "1.13.1"
description = "Label Studio annotation tool"
authors = [
    "Heartex <hello@heartex.ai>",
]
readme = "README.md"
license = "Apache-2.0"
classifiers = [
    "License :: OSI Approved :: Apache Software License",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
]
homepage = "https://github.com/heartexlabs/label-studio"
packages = [
    { include = "label_studio" },
]
include = [
    "web/dist/libs/datamanager/**/*",
    "web/dist/libs/editor/**/*",
    "web/dist/apps/labelstudio/**/*",
    "label_studio/annotation_templates/**/*",
    "label_studio/core/static/**/*",
    "label_studio/core/static_build/**/*",
    "label_studio/core/utils/schema/*.json",
    "label_studio/core/templatetags/*.py",
    "label_studio/core/version_.py",
    "label_studio/core/all_urls.json",
    "label_studio/io_storages/**/*.yml",
]

exclude = [
    "label_studio/frontend",
]

[tool.poetry.scripts]
label-studio = "label_studio.server:main"

[tool.poetry.dependencies]
python = ">=3.8,<4"
wheel = "<=0.40.0,>=0.38.1"
appdirs = ">=1.4.3"
attr = "0.3.1"
attrs = ">=19.2.0"
pyyaml = ">=6.0.0"
azure-storage-blob = ">=12.6.0"
boto = "^2.49.0"
boto3 = "^1.28.58"
botocore = "^1.31.58"
bleach = "~=5.0.0"
Django = "~=3.2.24"
django-storages = "1.12.3"
django-annoying = "0.10.6"
django-debug-toolbar = "3.2.1"
django-environ = "0.10.0"
django-filter = "2.4.0"
django-model-utils = "4.1.1"
django-rq = "2.5.1"
django-cors-headers = "3.6.0"
django-extensions = "3.1.0"
django-user-agents = "0.4.0"
django-ranged-fileresponse = ">=0.1.2"
drf-dynamic-fields = "0.3.0"
djangorestframework = "3.13.1"
drf-flex-fields = "0.9.5"
humansignal-drf-yasg = ">=1.21.9"
drf-generators = "0.3.0"
htmlmin = "0.1.12"
jsonschema = "3.2.0"
lockfile = ">=0.12.0"
lxml = ">=4.2.5"
defusedxml = ">=0.7.1"
numpy = "^1.24.3"
ordered-set = "4.0.2"
pandas = ">=0.24.0"
psycopg2-binary = "2.9.9"
pydantic = ">=2.7.3"
python-dateutil = ">=2.8.1"
pytz = "~=2022.1"
requests = "~=2.32.3"
urllib3 = "^1.26.18"
rq = "1.10.1"
rules = "2.2"
ujson = ">=3.0.0"
xmljson = "0.2.1"
colorama = ">=0.4.4"
boxing = ">=0.1.4"
redis = "~=3.5"
sentry-sdk = ">=1.1.0"
launchdarkly-server-sdk = "8.2.1"
python-json-logger = "2.0.4"
google-cloud-storage = "^2.13.0"
google-cloud-logging = "^3.10.0"
mysqlclient = {version = "*", optional = true}
django-csp = "3.7"
openai = "^1.10.0"

# Humansignal repo dependencies

label-studio-sdk = "1.0.5"

[tool.poetry.dev-dependencies]
pytest = "7.2.2"
pytest-cov = "2.12.1"
pytest-django = "4.1.0"
pytest-mock = "1.10.3"
tavern = "2.3.0"
fakeredis = "1.5.0"
pytest-env = "0.6.2"
responses = "0.13.0"
pytest-xdist = "~=2.5.0"
psutil = "5.9.4"
freezegun = "~=1.2.2"
pre-commit = "3.3.3"
s3transfer = "0.7.0"
mock = ">=5.1.0"
moto = ">=4.2.6"
requests-mock = "1.12.1"
twine = ">=4.0.2"

[tool.poetry.extras]
mysql = ["mysqlclient"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[[tool.poetry.source]]
name = "tsinghua-pypi"
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
default = true

Poetry Runtime Logs

poetry install
Updating dependencies
Resolving dependencies... (4839.8s)
dimbleby commented 1 month ago

Poetry version 1.1.15

There is no point in raising issues against such old versions, please upgrade, please close this

Secrus commented 1 month ago

New Poetry versions are faster in many operations and we haven't supported 1.1.x branch for some time now. If you experience this on modern versions, please open a new issue.

nicky132 commented 1 month ago

Poetry version 1.1.15

There is no point in raising issues against such old versions, please upgrade, please close this

`(myenv) [root@localhost label-studio-1.13.1]# poetry install Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source tsinghua-pypi. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'. Warning: Found deprecated priority 'default' for source 'tsinghua-pypi' in pyproject.toml. You can achieve the same effect by changing the priority to 'primary' and putting the source first.

Current Python version (3.6.8) is not allowed by the project (>=3.8,<4). Please change python executable via the "env use" command. (myenv) [root@localhost label-studio-1.13.1]# python --version Python 3.8.19 (myenv) [root@localhost label-studio-1.13.1]# which python /root/miniconda3/envs/myenv/bin/python (myenv) [root@localhost label-studio-1.13.1]# poetry env info Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source tsinghua-pypi. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'. Warning: Found deprecated priority 'default' for source 'tsinghua-pypi' in pyproject.toml. You can achieve the same effect by changing the priority to 'primary' and putting the source first.

Virtualenv Python: 3.6.8 Implementation: CPython Path: /root/.cache/pypoetry/virtualenvs/label-studio-D6emf7oA-py3.6 Executable: /root/.cache/pypoetry/virtualenvs/label-studio-D6emf7oA-py3.6/bin/python Valid: True

Base Platform: linux OS: posix Python: 3.6.8 Path: /usr Executable: /usr/bin/python3.6 (myenv) [root@localhost label-studio-1.13.1]# deactivate -bash: deactivate: command not found (myenv) [root@localhost label-studio-1.13.1]# deactivate -bash: deactivate: command not found (myenv) [root@localhost label-studio-1.13.1]# -bash: deactivate: command not found -bash: -bash:: command not found (myenv) [root@localhost label-studio-1.13.1]# conda deactivate (base) [root@localhost label-studio-1.13.1]# conda activate myenv (myenv) [root@localhost label-studio-1.13.1]# poetry env use /root/miniconda3/envs/myenv/bin/python Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source tsinghua-pypi. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'. Warning: Found deprecated priority 'default' for source 'tsinghua-pypi' in pyproject.toml. You can achieve the same effect by changing the priority to 'primary' and putting the source first. Creating virtualenv label-studio-D6emf7oA-py3.8 in /root/.cache/pypoetry/virtualenvs Using virtualenv: /root/.cache/pypoetry/virtualenvs/label-studio-D6emf7oA-py3.8 (myenv) [root@localhost label-studio-1.13.1]# poetry install Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source tsinghua-pypi. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'. Warning: Found deprecated priority 'default' for source 'tsinghua-pypi' in pyproject.toml. You can achieve the same effect by changing the priority to 'primary' and putting the source first. Updating dependencies Resolving dependencies... (66.4s)^C (myenv) [root@localhost label-studio-1.13.1]# poetry --version Poetry (version 1.8.3) (myenv) [root@localhost label-studio-1.13.1]# ` update already,still slow

nicky132 commented 1 month ago

New Poetry versions are faster in many operations and we haven't supported 1.1.x branch for some time now. If you experience this on modern versions, please open a new issue.

`WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. (myenv) [root@localhost local]# poetry --version Poetry (version 1.8.3) (myenv) [root@localhost local]# ll total 603616 drwxr-xr-x. 2 root root 4096 Sep 14 17:45 bin drwxr-xr-x. 2 root root 6 Apr 11 2018 etc drwxr-xr-x. 2 root root 6 Apr 11 2018 games -rw-r--r--. 1 root root 2266947 Sep 14 08:20 get-pip.py -rw-r--r--. 1 root root 638976 Sep 14 08:13 get-pip.py.1 -rw-r--r--. 1 root root 2266947 Aug 27 02:04 get-pip.py.2 drwxr-xr-x. 3 root root 23 Sep 14 11:36 include drwxr-xr-x. 13 root root 4096 Sep 14 18:56 label-studio-1.13.1 -rw-r--r--. 1 root root 283523928 Aug 26 16:04 label-studio-1.13.1.zip drwxr-xr-x. 5 root root 79 Sep 14 11:36 lib drwxr-xr-x. 3 root root 23 Sep 14 08:53 lib64 drwxr-xr-x. 2 root root 6 Apr 11 2018 libexec -rw-r--r--. 1 root root 148981743 Aug 23 00:47 Miniconda3-latest-Linux-x86_64.sh -rw-r--r--. 1 root root 130606004 Sep 14 21:27 Miniconda3-latest-Linux-x86_64.sh.1 drwxrwxr-x. 17 zhangkai zhangkai 4096 Sep 14 11:36 Python-3.8.10 -rw-r--r--. 1 root root 24720640 Sep 14 11:07 Python-3.8.10.tgz drwxrwxr-x. 17 zhangkai zhangkai 4096 Sep 14 08:08 Python-3.8.12 drwxrwxr-x. 3 zhangkai zhangkai 20 Sep 13 14:12 Python-3.8.12_bak -rw-r--r--. 1 root root 24769402 Aug 31 2021 Python-3.8.12.tgz -rw-r--r--. 1 root root 125272 Sep 13 14:07 Python-3.8.12.tgz.1 -rw-r--r--. 1 root root 163840 Sep 13 14:11 Python-3.8.12.tgz.2 drwxr-xr-x. 2 root root 6 Apr 11 2018 sbin drwxr-xr-x. 5 root root 49 Mar 28 2021 share drwxr-xr-x. 2 root root 6 Apr 11 2018 src drwxr-xr-x. 4 root root 64 Sep 14 18:46 venv -rw-r--r--. 1 root root 3705 Sep 14 21:27 wget-log (myenv) [root@localhost local]# cd label-studio-1.13.1 (myenv) [root@localhost label-studio-1.13.1]# poetry install Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source tsinghua-pypi. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'. Warning: Found deprecated priority 'default' for source 'tsinghua-pypi' in pyproject.toml. You can achieve the same effect by changing the priority to 'primary' and putting the source first.

Current Python version (3.6.8) is not allowed by the project (>=3.8,<4). Please change python executable via the "env use" command. (myenv) [root@localhost label-studio-1.13.1]# python --version Python 3.8.19 (myenv) [root@localhost label-studio-1.13.1]# which python /root/miniconda3/envs/myenv/bin/python (myenv) [root@localhost label-studio-1.13.1]# poetry env info Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source tsinghua-pypi. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'. Warning: Found deprecated priority 'default' for source 'tsinghua-pypi' in pyproject.toml. You can achieve the same effect by changing the priority to 'primary' and putting the source first.

Virtualenv Python: 3.6.8 Implementation: CPython Path: /root/.cache/pypoetry/virtualenvs/label-studio-D6emf7oA-py3.6 Executable: /root/.cache/pypoetry/virtualenvs/label-studio-D6emf7oA-py3.6/bin/python Valid: True

Base Platform: linux OS: posix Python: 3.6.8 Path: /usr Executable: /usr/bin/python3.6 (myenv) [root@localhost label-studio-1.13.1]# deactivate -bash: deactivate: command not found (myenv) [root@localhost label-studio-1.13.1]# deactivate -bash: deactivate: command not found (myenv) [root@localhost label-studio-1.13.1]# -bash: deactivate: command not found -bash: -bash:: command not found (myenv) [root@localhost label-studio-1.13.1]# conda deactivate (base) [root@localhost label-studio-1.13.1]# conda activate myenv (myenv) [root@localhost label-studio-1.13.1]# poetry env use /root/miniconda3/envs/myenv/bin/python Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source tsinghua-pypi. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'. Warning: Found deprecated priority 'default' for source 'tsinghua-pypi' in pyproject.toml. You can achieve the same effect by changing the priority to 'primary' and putting the source first. Creating virtualenv label-studio-D6emf7oA-py3.8 in /root/.cache/pypoetry/virtualenvs Using virtualenv: /root/.cache/pypoetry/virtualenvs/label-studio-D6emf7oA-py3.8 (myenv) [root@localhost label-studio-1.13.1]# poetry install Warning: Found deprecated key 'default' or 'secondary' in pyproject.toml configuration for source tsinghua-pypi. Please provide the key 'priority' instead. Accepted values are: 'default', 'primary', 'secondary', 'supplemental', 'explicit'. Warning: Found deprecated priority 'default' for source 'tsinghua-pypi' in pyproject.toml. You can achieve the same effect by changing the priority to 'primary' and putting the source first. Updating dependencies Resolving dependencies... (66.4s)^C (myenv) [root@localhost label-studio-1.13.1]# poetry --version Poetry (version 1.8.3) (myenv) [root@localhost label-studio-1.13.1]# ` have already update my poetry to the version 1.8.3 ,but i still got super slow Resolving dependencies....what can i do now?pls

github-actions[bot] commented 3 days ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.