Poetry cannot be installed on Github Actions runner using latest installer and Python 3.8.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Bắt đầu từ định nghĩa VirtualEnvironment.make của installer và tái hiện lỗi Windows GitHub Actions bằng Python 3.8 và installer mới nhất. So sánh đường dẫn tạo venv và lệnh venv._setup_pip được báo cáo; hoàn tất khi Poetry cài đặt thành công trong môi trường đó mà không gặp WinError 2.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- [N/A] If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
- OS version and name: Windows
- Poetry version: Latest
- Link of a Gist with the contents of your pyproject.toml file: N/A
Issue
After changing from the old installer process, i.e. curl -L https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -o get-poetry.py to the new installer process, i.e. curl -sSL https://install.python-poetry.org/ | POETRY_HOME=$HOME/.poetry python3 -, my builds are failing on Github Actions and Python 3.8: Poetry cannot be installed:
022-09-17T01:37:56.7561313Z ##[group]Run curl -sSL https://install.python-poetry.org | python3 -
2022-09-17T01:37:56.7561741Z [36;1mcurl -sSL https://install.python-poetry.org | python3 -[0m
2022-09-17T01:37:56.7572615Z shell: C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
2022-09-17T01:37:56.7572971Z env:
2022-09-17T01:37:56.7573137Z CI_PYTHON_VERSION: 3.8
2022-09-17T01:37:56.7573406Z pythonLocation: C:\hostedtoolcache\windows\Python\3.8.10\x64
2022-09-17T01:37:56.7573650Z ##[endgroup]
2022-09-17T01:37:59.4702925Z Retrieving Poetry metadata
2022-09-17T01:37:59.4703126Z
2022-09-17T01:37:59.4703425Z # Welcome to Poetry!
2022-09-17T01:37:59.4703691Z
2022-09-17T01:37:59.4703874Z This will download and install the latest version of Poetry,
2022-09-17T01:37:59.4704250Z a dependency and package manager for Python.
2022-09-17T01:37:59.4704413Z
2022-09-17T01:37:59.4704801Z It will add the `poetry` command to Poetry's bin directory, located at:
2022-09-17T01:37:59.4705053Z
2022-09-17T01:37:59.4705200Z C:\Users\runneradmin\AppData\Roaming\Python\Scripts
2022-09-17T01:37:59.4705368Z
2022-09-17T01:37:59.4705644Z You can uninstall at any time by executing this script with the --uninstall option,
2022-09-17T01:37:59.4705956Z and these changes will be reverted.
2022-09-17T01:37:59.4706100Z
2022-09-17T01:37:59.4706188Z Installing Poetry (1.2.1)
2022-09-17T01:37:59.4706429Z Installing Poetry (1.2.1): Creating environment
2022-09-17T01:37:59.4706740Z Installing Poetry (1.2.1): An error occurred. Removing partial environment.
2022-09-17T01:37:59.4963567Z Traceback (most recent call last):
2022-09-17T01:37:59.4970320Z File "<stdin>", line 935, in <module>
2022-09-17T01:37:59.4970900Z File "<stdin>", line 914, in main
2022-09-17T01:37:59.4971289Z File "<stdin>", line 545, in run
2022-09-17T01:37:59.4971657Z File "<stdin>", line 566, in install
2022-09-17T01:37:59.4972175Z File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\contextlib.py", line 113, in __enter__
2022-09-17T01:37:59.4972602Z return next(self.gen)
2022-09-17T01:37:59.4972971Z File "<stdin>", line 638, in make_env
2022-09-17T01:37:59.4973331Z File "<stdin>", line 624, in make_env
2022-09-17T01:37:59.4973679Z File "<stdin>", line 314, in make
2022-09-17T01:37:59.4974144Z File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\venv\__init__.py", line 68, in create
2022-09-17T01:37:59.4974571Z self._setup_pip(context)
2022-09-17T01:37:59.4975025Z File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\venv\__init__.py", line 289, in _setup_pip
2022-09-17T01:37:59.4975508Z subprocess.check_output(cmd, stderr=subprocess.STDOUT)
2022-09-17T01:37:59.4976022Z File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\subprocess.py", line 415, in check_output
2022-09-17T01:37:59.4976513Z return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
2022-09-17T01:37:59.4977012Z File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\subprocess.py", line 493, in run
2022-09-17T01:37:59.4977453Z with Popen(*popenargs, **kwargs) as process:
2022-09-17T01:37:59.4977935Z File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\subprocess.py", line 858, in __init__
2022-09-17T01:37:59.4978405Z self._execute_child(args, executable, preexec_fn, close_fds,
2022-09-17T01:37:59.4978916Z File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\subprocess.py", line 1311, in _execute_child
2022-09-17T01:37:59.4979397Z hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
2022-09-17T01:37:59.4979834Z FileNotFoundError: [WinError 2] The system cannot find the file specified
2022-09-17T01:37:59.5142470Z ##[error]Process completed with exit code 1.
2022-09-17T01:37:59.5272597Z Cleaning up orphan processes
An exception is raised in the new installer make definition:
@classmethod
def make(cls, target: Path) -> "VirtualEnvironment":
try:
# on some linux distributions (eg: debian), the distribution provided python
# installation might not include ensurepip, causing the venv module to
# fail when attempting to create a virtual environment
# we import ensurepip but do not use it explicitly here
import ensurepip # noqa: F401
import venv
builder = venv.EnvBuilder(clear=True, with_pip=True, symlinks=False)
context = builder.ensure_directories(target)
if (
WINDOWS
and hasattr(context, "env_exec_cmd")
and context.env_exe != context.env_exec_cmd
):
target = target.resolve()
builder.create(target)
except ImportError:
# fallback to using virtualenv package if venv is not available, eg: ubuntu
python_version = f"{sys.version_info.major}.{sys.version_info.minor}"
virtualenv_bootstrap_url = (
f"https://bootstrap.pypa.io/virtualenv/{python_version}/virtualenv.pyz"
)
with tempfile.TemporaryDirectory(prefix="poetry-installer") as temp_dir:
virtualenv_pyz = Path(temp_dir) / "virtualenv.pyz"
request = Request(
virtualenv_bootstrap_url, headers={"User-Agent": "Python Poetry"}
)
virtualenv_pyz.write_bytes(urlopen(request).read())
cls.run(
sys.executable, virtualenv_pyz, "--clear", "--always-copy", target
)
# We add a special file so that Poetry can detect
# its own virtual environment
target.joinpath("poetry_env").touch()
env = cls(target)
# we do this here to ensure that outdated system default pip does not trigger older bugs
env.pip("install", "--disable-pip-version-check", "--upgrade", "pip")
return env
Specifically, the venv._setup_pip definition seems to not find the Python interpreter for the Poetry environment:
def _setup_pip(self, context):
"""Installs or upgrades pip in a virtual environment"""
# We run ensurepip in isolated mode to avoid side effects from
# environment vars, the current directory and anything else
# intended for the global Python environment
cmd = [context.env_exec_cmd, '-Im', 'ensurepip', '--upgrade',
'--default-pip']
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
I have a repo with a small repro case here: https://github.com/KelSolaar/ActionsRamblings/actions/runs/3071692472/jobs/4962601087
- Ngôn ngữ chính
- Python
- Star
- 255
- Fork
- 65
- Merge trung bình
- 2 giờ 48 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python-poetry/install.python-poetry.org
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
python-poetry/install.python-poetry.org#144 · 8 bình luận · 2 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
python-poetry/install.python-poetry.org#177 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của python-poetry/install.python-poetry.org
Issue tương tự
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
debpalash/VoiceStudio#2624 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
SQLGlot translates Spark concat_ws on an array into array stringificationCó thể đã có người làm @ansh-rohilla đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Make Catch2 optional when `RDK_BUILD_CPP_TESTS=OFF`Có thể đã có người làm @pechersky đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày