Readthedocs.org: python 3.6으둜 virtualenvμ—μ„œ μ‹œμž‘ν–ˆμŒμ—λ„ λΆˆκ΅¬ν•˜κ³  λ¬Έμ„œ λΉŒλ“œμš© Python 인터프리터가 Python 3.7둜 κ°•μ œ 싀행됨

에 λ§Œλ“  2019λ…„ 02μ›” 21일  Β·  4μ½”λ©˜νŠΈ  Β·  좜처: readthedocs/readthedocs.org

μ„ΈλΆ€

이것은 데λͺ¨ ν”„λ‘œμ νŠΈμ˜ κ²½μš°μ—λ„ λ¬Έμ„œ λΉŒλ“œλ₯Ό νŠΈλ¦¬κ±°ν•˜λ €κ³  ν•  λ•Œ λ°œμƒν•©λ‹ˆλ‹€. Ubuntu 18.04와 Amazon Linux 2 λͺ¨λ‘μ— μƒˆλ‘œ μ„€μΉ˜ν•  λ•Œ 이 μž‘μ—…μ„ μˆ˜ν–‰ν–ˆμŠ΅λ‹ˆλ‹€.

λ‚΄ Ubuntu 슀크립트:

apt update
apt upgrade -y
apt install -y latexmk texlive texlive-science texlive-formats-extra git redis python3-dev

git clone https://github.com/rtfd/readthedocs.org.git
cd readthedocs.org
echo "    SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')" >> readthedocs/settings/base.py

python3 -m venv --without-pip venv
source venv/bin/activate
curl -s https://bootstrap.pypa.io/get-pip.py | python

pip install -r requirements.txt
pip install django-allauth

python manage.py migrate
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin<strong i="8">@localhost</strong>', 'admin')" | python ./manage.py shell
python manage.py collectstatic
python manage.py loaddata test_data

python manage.py runserver 0.0.0.0:8000

였λ₯˜:

[21/Feb/2019 19:22:26] readthedocs.doc_builder.environments:599[1832]: WARNING (Build) [admin-demo:latest] Command python3.7 -mvirtualenv --no-site-packages --no-download /home/ubuntu/readthedocs.org/user_builds/admin-demo/envs/latest failed:
Traceback (most recent call last):
  File "/home/ubuntu/readthedocs.org/readthedocs/doc_builder/environments.py", line 178, in run
    env=environment,
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'python3.7': 'python3.7'
Traceback (most recent call last):
  File "/home/ubuntu/readthedocs.org/readthedocs/projects/tasks.py", line 558, in run_build
    self.setup_python_environment()
  File "/home/ubuntu/readthedocs.org/readthedocs/projects/tasks.py", line 784, in setup_python_environment
    self.python_env.setup_base()
  File "/home/ubuntu/readthedocs.org/readthedocs/doc_builder/python_environments.py", line 258, in setup_base
    cwd='$HOME',
  File "/home/ubuntu/readthedocs.org/readthedocs/doc_builder/environments.py", line 612, in run
    return super().run(*cmd, **kwargs)
  File "/home/ubuntu/readthedocs.org/readthedocs/doc_builder/environments.py", line 403, in run
    return self.run_command_class(cls=self.command_class, cmd=cmd, **kwargs)
  File "/home/ubuntu/readthedocs.org/readthedocs/doc_builder/environments.py", line 618, in run_command_class
    return super().run_command_class(*cmd, **kwargs)
  File "/home/ubuntu/readthedocs.org/readthedocs/doc_builder/environments.py", line 472, in run_command_class
    raise BuildEnvironmentWarning(msg)
readthedocs.doc_builder.exceptions.BuildEnvironmentWarning: Command python3.7 -mvirtualenv --no-site-packages --no-download /home/ubuntu/readthedocs.org/user_builds/admin-demo/envs/latest failed:
Traceback (most recent call last):
  File "/home/ubuntu/readthedocs.org/readthedocs/doc_builder/environments.py", line 178, in run
    env=environment,
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'python3.7': 'python3.7'

μ˜ˆμƒ κ²°κ³Ό

λ¬Έμ„œ λΉŒλ“œ

μ‹€μ œ κ²°κ³Ό

Python 3.7 λˆ„λ½ 였λ₯˜

이것은 λ™μΌν•œ μ„€μ • 슀크립트λ₯Ό μ‚¬μš©ν•˜μ—¬ 이것을 μ‹œλ„ν–ˆμ„ λ•Œ λ©°μΉ  전에 λ°œμƒν•˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.

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

이것은 μ• ν”Œλ¦¬μΌ€μ΄μ…˜ 싀행을 μœ„ν•΄ Python 3.7을 μ§€μ›ν•˜μ§€ μ•ŠλŠ”λ‹€λŠ” 점을 κ³ λ €ν•  λ•Œ μ΄μƒν•œ μƒνƒœλ‘œ λ³΄μž…λ‹ˆλ‹€(#4756).

기본적으둜 두 가지 λ²„μ „μ˜ Python이 ν•„μš”ν•œ μ΄μœ λŠ” λ¬΄μ—‡μž…λ‹ˆκΉŒ? μ΄λŠ” κΈ°λ³Έ λ™μž‘μ„ μˆ˜ν–‰ν•˜κΈ°μ— 쒋은 μƒνƒœκ°€ μ•„λ‹™λ‹ˆλ‹€.

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

λ¬Έμ„œ μž‘μ„±μ€ μ• ν”Œλ¦¬μΌ€μ΄μ…˜κ³Ό λ³„κ°œμž…λ‹ˆλ‹€. μ΅œμ‹  λ¦΄λ¦¬μŠ€μ—μ„œλŠ” 기본적으둜 3.7둜 μ„€μ •λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. ꡬ성 νŒŒμΌμ„ μ‚¬μš©ν•˜μ—¬ λ‹€λ₯Έ Python 버전을 μ‚¬μš©ν•˜κ±°λ‚˜ readthedocs/settingsμ—μ„œ κΈ°λ³Έ 섀정을 λ³€κ²½ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

이 μž‘μ—…μ„ μˆ˜ν–‰ν•˜λŠ” 방법을 μ„€λͺ…ν•˜μ‹­μ‹œμ˜€. λ¬Έμ„œν™”λ˜μ–΄ μžˆμŠ΅λ‹ˆκΉŒ?

ꡬ성 파일 μ‚¬μš© https://docs.readthedocs.io/en/stable/config-file/v2.html

λ˜λŠ” μ„€μ •μ—μ„œ 3.7을 μ œκ±°ν•  수 μžˆμŠ΅λ‹ˆλ‹€. https://github.com/rtfd/readthedocs.org/blob/ed8dd29a68d009fc08929fabf7155883482619c1/readthedocs/settings/base.py#L292 -L294(μ΅œμ‹  λ²„μ „μ—μ„œ 이미지λ₯Ό μ‚¬μš©ν•˜κΈ° λ•Œλ¬Έμ—)

그리고 μš°λ¦¬λŠ” ν”„λ‘œλ•μ…˜μ—μ„œ 도컀λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.

이것은 μ• ν”Œλ¦¬μΌ€μ΄μ…˜ 싀행을 μœ„ν•΄ Python 3.7을 μ§€μ›ν•˜μ§€ μ•ŠλŠ”λ‹€λŠ” 점을 κ³ λ €ν•  λ•Œ μ΄μƒν•œ μƒνƒœλ‘œ λ³΄μž…λ‹ˆλ‹€(#4756).

기본적으둜 두 가지 λ²„μ „μ˜ Python이 ν•„μš”ν•œ μ΄μœ λŠ” λ¬΄μ—‡μž…λ‹ˆκΉŒ? μ΄λŠ” κΈ°λ³Έ λ™μž‘μ„ μˆ˜ν–‰ν•˜κΈ°μ— 쒋은 μƒνƒœκ°€ μ•„λ‹™λ‹ˆλ‹€.

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