Virtualenv: [20.0.10] μœˆλ„μš° μŠ€ν† μ–΄ 지원

에 λ§Œλ“  2020λ…„ 03μ›” 10일  Β·  6μ½”λ©˜νŠΈ  Β·  좜처: pypa/virtualenv

1362 ν΄λ ˆμž„μ΄ μ§€μ›ν•˜μ§€λ§Œ μ›ν•˜λŠ” λŒ€λ‘œ μž‘λ™ν•˜μ§€ μ•ŠλŠ” 것 κ°™μŠ΅λ‹ˆλ‹€.

(venv) C:\Users\IEUser\astpretty>virtualenv v -vvv --with-traceback
390 setup logging to NOTSET [DEBUG report:43]
468 could not create app data folder C:\Users\IEUser\AppData\Local\pypa\virtualenv due to FileNotFoundError(2, 'The system cannot find the path specified') [INFO app_data:54]
577 created temporary app data folder C:\Users\IEUser\AppData\Local\Temp\tmpaqvhomd3 [DEBUG app_data:32]
624 find interpreter for spec PythonSpec(path=c:\users\ieuser\astpretty\venv\scripts\python.exe) [INFO builtin:44]
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\IEUser\astpretty\venv\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\__main__.py", line 50, in run_with_catch
    run(args, options)
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\__main__.py", line 20, in run
    session = cli_run(args, options)
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\run\__init__.py", line 27, in cli_run
    session = session_via_cli(args, options)
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\run\__init__.py", line 35, in session_via_cli
    parser = build_parser(args, options)
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\run\__init__.py", line 71, in build_parser
    parser._interpreter = interpreter = discover.interpreter
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\discovery\discover.py", line 44, in interpreter
    self._interpreter = self.run()
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\discovery\builtin.py", line 33, in run
    return get_interpreter(self.python_spec, self.app_data.folder)
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\discovery\builtin.py", line 46, in get_interpreter
    for interpreter, impl_must_match in propose_interpreters(spec, app_data):
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\discovery\builtin.py", line 60, in propose_interpreters
    yield PythonInfo.from_exe(spec.path, app_data), True
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\discovery\py_info.py", line 293, in from_exe
    proposed = proposed._resolve_to_system(app_data, proposed)
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\discovery\py_info.py", line 328, in _resolve_to_system
    target = cls.from_exe(target.system_executable, app_data)
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\discovery\py_info.py", line 290, in from_exe
    proposed = from_exe(cls, app_data, exe, raise_on_error=raise_on_error, ignore_cache=ignore_cache)
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\discovery\cached_py_info.py", line 32, in from_exe
    result = _get_from_cache(cls, py_info_cache, app_data, exe, ignore_cache=ignore_cache)
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\discovery\cached_py_info.py", line 56, in _get_from_cache
    py_info = _get_via_file_cache(cls, py_info_cache, app_data, exe_path, exe)
  File "c:\users\ieuser\astpretty\venv\lib\site-packages\virtualenv\discovery\cached_py_info.py", line 68, in _get_via_file_cache
    resolved_path_modified_timestamp = resolved_path.stat().st_mtime
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\pathlib.py", line 1178, in stat
    return self._accessor.stat(self)
OSError: [WinError 1920] The file cannot be accessed by the system: 'C:\\Users\\IEUser\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\python.exe'

Windows 10μ—μ„œ Windows μŠ€ν† μ–΄ python 3.7.6을 μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

(venv) C:\Users\IEUser\astpretty>python --version --version
Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 01:54:44) [MSC v.1916 64 bit (AMD64)]

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

@asottile μŠ¬ν”„κ²Œλ„ CIμ—μ„œ Windows μŠ€ν† μ–΄ νŒŒμ΄μ¬μ„ ν™•λ³΄ν•˜λŠ” 것은 λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€. λ‚΄κ°€ 보자, κ·Έ PR 직후에 νš¨κ³Όκ°€ μžˆμ—ˆλ‹€. κ·Έ κ²°μ˜κ°€ μ—¬κΈ° 세상을 망친 것 κ°™κ΅°...

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

λ˜ν•œ 였λ₯˜κ°€ λ°œμƒν•˜μ§€ μ•Šκ³  μ˜΅μ…˜μ„ ν‘œμ‹œν•˜κΈ° μœ„ν•΄ --help λ₯Ό μ‹€ν–‰ν•  수 μ—†μŠ΅λ‹ˆλ‹€.

@asottile μŠ¬ν”„κ²Œλ„ CIμ—μ„œ Windows μŠ€ν† μ–΄ νŒŒμ΄μ¬μ„ ν™•λ³΄ν•˜λŠ” 것은 λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€. λ‚΄κ°€ 보자, κ·Έ PR 직후에 νš¨κ³Όκ°€ μžˆμ—ˆλ‹€. κ·Έ κ²°μ˜κ°€ μ—¬κΈ° 세상을 망친 것 κ°™κ΅°...

κ·Έλž˜μ„œ μ—¬κΈ° 범인은 λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

PS C:\Users\traveler\git\virtualenv> python -c 'import sys; from pathlib import Path; import os; print(sys.executable); print(os.path.exists(sys.executable)); print(Path(sys.executable).exists())'
C:\Users\traveler\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe
False
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\pathlib.py", line 1356, in exists
    self.stat()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\pathlib.py", line 1178, in stat
    return self._accessor.stat(self)
OSError: [WinError 1920] The file cannot be accessed by the system: 'C:\\Users\\traveler\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\python.exe'

κ·Έλž˜μ„œ μš°λ¦¬λŠ” 경둜의 쑴재λ₯Ό 확인할 μΆ©λΆ„ν•œ κΆŒν•œμ΄ μ—†μ§€λ§Œ μ‹€ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€. pathlib λŠ” μ˜ˆμ™Έλ₯Ό λ°œμƒμ‹œν‚€κ³  os.path.exists λŠ” μžλ™ False λ°˜ν™˜ν•©λ‹ˆλ‹€.

cc @zooba λ‚˜λŠ” 이것이 μ„€κ³„λœ λŒ€λ‘œ μž‘λ™ν•  κ²ƒμœΌλ‘œ κΈ°λŒ€ν•©λ‹ˆκΉŒ?

3.8μ—μ„œ μˆ˜μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€. Windowsμ—μ„œ 좔적할 수 μ—†κ³  읽을 수 μ—†λŠ” μž¬λΆ„μ„ 지점(μ΄μ „μ—λŠ” μ‹€μ œλ‘œ μ‘΄μž¬ν•œ 적이 μ—†μŒ)κ³Ό 기타 μ—¬λŸ¬ 가지 경우λ₯Ό μ²˜λ¦¬ν•˜κΈ° μœ„ν•΄ stat() λ₯Ό λ‹€μ‹œ μž‘μ„±ν–ˆμŠ΅λ‹ˆλ‹€.

os.lstat() λŠ” Python 3.7μ—μ„œ μž‘λ™ν•˜λ―€λ‘œ 이λ₯Ό λŒ€μ‹  μ‚¬μš©ν•  수 μžˆλŠ” 방법이 있으면 μ‹œλ„ν•΄ λ³΄μ„Έμš”. 그렇지 μ•ŠμœΌλ©΄ μŠ€ν† μ–΄μ—μ„œ Python 3.7을 λ²”μœ„λ₯Ό 벗어남/μ§€μ›λ˜μ§€ μ•ŠμŒμœΌλ‘œ μ„ μ–Έν•˜μ„Έμš”. κ·Έλž˜μ„œ "μ‹€ν—˜μ " ν‘œμ‹œλ₯Ό ν•΄λ‘μ—ˆμŠ΅λ‹ˆλ‹€.

κ·Έλž˜μ„œ μ €λŠ” 이 κ²½μš°μ— store python 3.7을 μ‚­μ œν•˜κ³  μ‹ΆμŠ΅λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ λ‚΄κ°€ κ²ͺ은 또 λ‹€λ₯Έ λ¬Έμ œλŠ” store python --symlinks λ©”μ†Œλ“œκ°€ μ‹€ν–‰ν•  수 μ—†λŠ” 가상 ν™˜κ²½μ„ μƒμ„±ν•œλ‹€λŠ” κ²ƒμž…λ‹ˆλ‹€. 생성 쀑이 μ•„λ‹ˆλΌ 생성 ν›„μ—λ§Œ μ‹€νŒ¨ν•©λ‹ˆλ‹€.

μ•ˆλ…•ν•˜μ„Έμš”, 이 λ¬Έμ œμ— λŒ€ν•œ μˆ˜μ • 사항이 virtualenv 20.0.11을 톡해 λ¦΄λ¦¬μŠ€λ˜μ—ˆμŠ΅λ‹ˆλ‹€. https://pypi.org/project/virtualenv/20.0.11/(https://virtualenv.pypa.io/en/latest/changelog.html#v20-0-11-2020-03-18)을 μ°Έμ‘° ν•˜μ‹­μ‹œμ˜€ . μ‹œλ„ν•΄λ³΄κ³  λ¬Έμ œκ°€ ν•΄κ²°λ˜μ§€ μ•Šμ€ 경우 λ‹€μ‹œ λ³΄κ³ ν•˜μ‹­μ‹œμ˜€. 그렇지 μ•Šμ€ 경우 여기에 λŒ“κΈ€μ„ λ‹¬μ•„μ£Όμ‹œλ©΄ 티켓을 λ‹€μ‹œ μ—΄κ² μŠ΅λ‹ˆλ‹€. 이둜 인해 λΆˆνŽΈμ„ λ“œλ € μ£„μ†‘ν•˜κ³  이 μƒˆλ‘œμš΄ μ£Όμš” 릴리슀둜 예기치 μ•Šμ€ 버그λ₯Ό ν•΄κ²°ν•˜λŠ” λ™μ•ˆ κΈ°λ‹€λ € μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€.
thanks

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