<p>ν˜Έν™˜λ˜μ§€ μ•ŠλŠ” μ œμ•½ 쑰건에도 λΆˆκ΅¬ν•˜κ³  pipκ°€ μ„±κ³΅μ μœΌλ‘œ μ’…λ£Œλ©λ‹ˆλ‹€.</p>

에 λ§Œλ“  2019λ…„ 09μ›” 03일  Β·  3μ½”λ©˜νŠΈ  Β·  좜처: pypa/pip

ν™˜κ²½

  • 핍 버전: 19.2.3
  • 파이썬 버전: 3.7.4
  • 운영 체제: macOS 18.7.0

이것은 docker run python:3 μ‚¬μš©ν•˜μ—¬ μž¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

μ„€λͺ…

μ œμ•½ 쑰건 파일이 ν˜Έν™˜λ˜μ§€ μ•ŠλŠ” 버전을 μ§€μ •ν•˜λŠ” 경우 pipλŠ” 쒅속성이 μ†μƒλœ νŒ¨ν‚€μ§€λ₯Ό μ„€μΉ˜ν•©λ‹ˆλ‹€. 였λ₯˜ λ©”μ‹œμ§€κ°€ ν‘œμ‹œλ˜μ§€λ§Œ μ’…λ£Œ μ½”λ“œλŠ” 0 μž…λ‹ˆλ‹€.

예λ₯Ό λ“€μ–΄ environs 5.2.1 μ—λŠ” marshmallow>=2.7.0 κ°€ ν•„μš”ν•˜μ§€λ§Œ ν›„μžκ°€ μ œμ•½ 쑰건 νŒŒμΌμ— μ§€μ •λœ 경우 pipλŠ” marshmallow 2.6.0 와 ν•¨κ»˜ μ„€μΉ˜ν•©λ‹ˆλ‹€.

μ˜ˆμƒλ˜λŠ” 행동

pipλŠ” νŒ¨ν‚€μ§€λ₯Ό μ„€μΉ˜ν•˜μ§€ μ•Šμ•„μ•Ό ν•˜λ©° μ‹€νŒ¨λ‘œ μ’…λ£Œλ©λ‹ˆλ‹€.

λ²ˆμ‹ 방법

  1. marshmallow==2.6.0 constraint.txt 생성
  2. environs==5.2.1 requirements.txt 생성
  3. pip install -r requirements.txt -c constraints.txt

μ‚°μΆœ

$ docker run --rm -ti python:3 sh
# python -V
Python 3.7.4
# pip -V
pip 19.2.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
# uname -a
Linux 4d4f16cc965f 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 GNU/Linux
# echo marshmallow==2.6.0 > constraints.txt
# echo environs==5.2.1 > requirements.txt
# pip install -r requirements.txt -c constraints.txt
Collecting environs==5.2.1 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/5f/c9/6b576b8b374dfe78d9435988e6a53497822f31b9da5bdd446343ad1a4d1b/environs-5.2.1-py2.py3-none-any.whl
Collecting marshmallow==2.6.0 (from -c constraints.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/33/44/c3bdd4222909b6452ebe5c028ea5dbe7e9409307b3b933026218c677fcf1/marshmallow-2.6.0-py2.py3-none-any.whl (44kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 51kB 729kB/s
Collecting python-dotenv (from environs==5.2.1->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/57/c8/5b14d5cffe7bb06bedf9d66c4562bf90330d3d35e7f0266928c370d9dd6d/python_dotenv-0.10.3-py2.py3-none-any.whl
ERROR: environs 5.2.1 has requirement marshmallow>=2.7.0, but you'll have marshmallow 2.6.0 which is incompatible.
Installing collected packages: marshmallow, python-dotenv, environs
Successfully installed environs-5.2.1 marshmallow-2.6.0 python-dotenv-0.10.3
# echo $?
0
duplicate auto-locked awaiting response support

λͺ¨λ“  3 λŒ“κΈ€

이것은 본질적으둜 #988κ³Ό λ™μΌν•©λ‹ˆλ‹€(μ°Έμ‘°: #5137).

Pip은 처음 μ ‘ν•˜λŠ” κΈ°μ€€μœΌλ‘œ μš”κ΅¬ 사항을 νŒŒμ•…ν•©λ‹ˆλ‹€(예고 없이 변경될 수 있음). μš”κ΅¬ 사항 파일과 μ œμ•½ 쑰건 파일이 ꡬ문 λΆ„μ„λ˜λ©΄ environs==5.2.1 κ°€ μš”κ΅¬ μ‚¬ν•­μœΌλ‘œ, marshmallow==2.6.0 κ°€ μ œμ•½ 쑰건으둜 ν‘œμ‹œλ©λ‹ˆλ‹€. environs κ°€ 처리 쀑일 λ•Œ marshmallow κ°€ μ’…μ†μ„±μœΌλ‘œ μΈμ‹λ˜κ³  κΈ°μ‘΄ ν•­λͺ©( marshmallow==2.6.0 )이 μš”κ΅¬ μ‚¬ν•­μœΌλ‘œ ν‘œμ‹œλ˜κ³  κΈ°μ‘΄ 버전이 μ„€μΉ˜μ— μ‚¬μš©λ˜λŠ” λ²„μ „μž…λ‹ˆλ‹€. . μ‚¬μš©μžκ°€ μ œκ³΅ν•œ 값을 μ‚¬μš©ν•˜λŠ” 것이 (λ‹¨μˆœνžˆ μ œμ•½ 쑰건일지라도) μ—¬κΈ°μ—μ„œ μš°λ¦¬κ°€ ν•  수 μžˆλŠ” κ°€μž₯ μ˜¬λ°”λ₯Έ λ™μž‘μ΄λΌκ³  μƒκ°ν•©λ‹ˆλ‹€.

μΆ”μ λ˜λŠ” 였λ₯˜λŠ” 일반 pip install environs==5.2.1 marshmallow==2.6.0 λ˜λŠ” pip install environs==5.2.1 && pip install marshmallow==2.6.0 와 같은 κ°œλ³„ ν˜ΈμΆœμ— λŒ€ν•΄ μΆ”μ λ˜λŠ” 것과 λ™μΌν•©λ‹ˆλ‹€.

이것은 #5000에 μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μ’…λ£Œ μ½”λ“œκ°€ 1이 μ•„λ‹Œ μ΄μœ λŠ” 이전 λ²„μ „κ³Όμ˜ ν˜Έν™˜μ„± λ•Œλ¬Έμž…λ‹ˆλ‹€.

이것이 μΌμ–΄λ‚˜κ³  μžˆλ‹€λŠ” 것을 ν”„λ‘œκ·Έλž˜λ° λ°©μ‹μœΌλ‘œ μ•Œκ³  μ‹Άλ‹€λ©΄ pip check λ₯Ό μ‹€ν–‰ν•˜κ³  μ‹ΆμŠ΅λ‹ˆλ‹€.

이 ν˜ΈλŠ” μ›μ €μžμ˜ μΆ”κ°€ 정보 μš”μ²­μ— λŒ€ν•œ 응닡이 μ—†μ—ˆκΈ° λ•Œλ¬Έμ— μžλ™μœΌλ‘œ μ’…λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€. ν˜„μž¬ λ¬Έμ œμ— μžˆλŠ” μ •λ³΄λ§ŒμœΌλ‘œλŠ” 쑰치λ₯Ό μ·¨ν•˜κΈ°μ— μΆ©λΆ„ν•œ 정보가 μ—†μŠ΅λ‹ˆλ‹€. 더 쑰사할 수 μžˆλ„λ‘ ν•„μš”ν•œ 닡변이 μžˆκ±°λ‚˜ 찾으면 연락해 μ£Όμ‹­μ‹œμ˜€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰