{"id":1786,"date":"2020-10-17T12:42:55","date_gmt":"2020-10-17T10:42:55","guid":{"rendered":"https:\/\/netspider.com.ua\/?p=1786"},"modified":"2020-10-17T12:44:19","modified_gmt":"2020-10-17T10:44:19","slug":"alternativnyj-python","status":"publish","type":"post","link":"https:\/\/netspider.com.ua\/index.php\/2020\/10\/17\/alternativnyj-python\/","title":{"rendered":"\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 python"},"content":{"rendered":"\n<p>\u0412 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Linux, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 Debian (Debian, Ubuntu, Mint, Kali \u0438 \u0442.\u0434.), \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0441\u0438\u0439 python. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>ls<\/code>\u00a0\u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435:<\/p>\n<pre>$ ls \/usr\/bin\/python*\n\/usr\/bin\/python  \/usr\/bin\/python2  \/usr\/bin\/python2.7  \/usr\/bin\/python3  \/usr\/bin\/python3.8  \/usr\/bin\/python3.8m  \/usr\/bin\/python3m\n<\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f python \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435:<\/p>\n<pre>$ python --version\nPython 2.7.8\n<\/pre>\n<h2>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 python \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e python \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u0440\u043e\u0441\u0442\u043e\u00a0\u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 <code>alias<\/code>\u00a0\u0434\u043b\u044f \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435\u00a0\u0444\u0430\u0439\u043b <code>~\/.bashrc<\/code>\u00a0\u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 alias \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 python \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<pre>alias python='\/usr\/bin\/python3.8'\n<\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043b\u043e\u0433\u0438\u043d\u044c\u0442\u0435\u0441\u044c \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0439\u0442\u0435\u00a0\u0444\u0430\u0439\u043b <code>.bashrc<\/code>:<\/p>\n<pre>$ . ~\/.bashrc\n<\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432\u0435\u0440\u0441\u0438\u044e python \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<pre>$ python --version\nPython 3.8.5\n<\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043d\u0435 bash, \u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443, \u0432\u043d\u0435\u0441\u0438\u0442\u0435 \u0430\u043b\u0438\u0430\u0441 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 .rc-\u0444\u0430\u0439\u043b.<\/p>\n<p><!--more--><\/p>\n<h2>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 python \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e python \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443\u00a0<code>update-alternatives<\/code>. \u0417\u0430\u043b\u043e\u0433\u0438\u043d\u044c\u0442\u0435\u0441\u044c \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c root (\u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 sudo c \u0434\u0430\u043b\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438) \u0438 \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 python \u043d\u0430 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435:<\/p>\n<pre># update-alternatives --list python\nupdate-alternatives: error: no alternatives for python\n<\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432\u044b\u0448\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>update-alternatives<\/code> \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b python. \u041d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b python, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0441\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>python2.7<\/code>\u00a0\u0438\u00a0<code>python3.8<\/code>:<\/p>\n<pre># update-alternatives --install \/usr\/bin\/python python \/usr\/bin\/python2.7 1\nupdate-alternatives: using \/usr\/bin\/python2.7 to provide \/usr\/bin\/python (python) in auto mode\n# update-alternatives --install \/usr\/bin\/python python \/usr\/bin\/python3.8 2\nupdate-alternatives: using \/usr\/bin\/python3.8 to provide \/usr\/bin\/python (python) in auto mode\n<\/pre>\n<p>\u041a\u043b\u044e\u0447\u00a0<code>--install<\/code>\u00a0\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0438, \u0435\u0441\u043b\u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 2 \u0434\u043b\u044f <code>\/usr\/bin\/python3.8<\/code>\u00a0\u0438, \u043a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, <code>\/usr\/bin\/python3.8<\/code>\u00a0\u0431\u044b\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439\u00a0<code>update-alternatives<\/code>\u00a0\u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 python.<\/p>\n<pre># python --version\nPython 3.8.5\n<\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 python:<\/p>\n<pre># update-alternatives --list python\n\/usr\/bin\/python2.7\n\/usr\/bin\/python3.8\n<\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0432 \u043b\u044e\u0431\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430\u043c\u0438 \u0432\u0432\u0435\u0434\u044f \u043d\u0438\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438 \u0432\u0432\u043e\u0434\u044f \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439:<\/p>\n<pre># update-alternatives --config python\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1787 size-full\" src=\"https:\/\/img2.netspider.com.ua\/2020\/10\/default-python.png\" alt=\"update-alternatives\" width=\"973\" height=\"555\" srcset=\"https:\/\/img2.netspider.com.ua\/2020\/10\/default-python.png 973w, https:\/\/img2.netspider.com.ua\/2020\/10\/default-python-300x171.png 300w, https:\/\/img2.netspider.com.ua\/2020\/10\/default-python-768x438.png 768w, https:\/\/img2.netspider.com.ua\/2020\/10\/default-python-660x376.png 660w\" sizes=\"auto, (max-width: 973px) 100vw, 973px\" \/><\/p>\n<pre># python --version\nPython 2.7.8\n<\/pre>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u0430 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0432\u0435\u0440\u0441\u0438\u0439 python, \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0430 <code>update-alternatives<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u0434\u0430\u043b\u0438\u043c \u0432\u0435\u0440\u0441\u0438\u044e python2.7:<\/p>\n<pre># update-alternatives --remove python \/usr\/bin\/python2.7\nupdate-alternatives: removing manually selected alternative - switching python to auto mode\nupdate-alternatives: using \/usr\/bin\/python3.8 to provide \/usr\/bin\/python (python) in auto mode\n<\/pre>\n<p><a href=\"https:\/\/linuxconfig.org\/how-to-change-from-default-to-alternative-python-version-on-debian-linux\" target=\"_blank\" rel=\"noopener noreferrer\"><em>\u041f\u043e \u043c\u043e\u0442\u0438\u0432\u0430\u043c \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/em><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"\u0412 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Linux, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 Debian (Debian, Ubuntu, Mint, Kali \u0438 \u0442.\u0434.), \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0441\u0438\u0439 python. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 ls\u00a0\u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435: $ ls \/usr\/bin\/python* \/usr\/bin\/python \/usr\/bin\/python2 \/usr\/bin\/python2.7 \/usr\/bin\/python3 \/usr\/bin\/python3.8 \/usr\/bin\/python3.8m \/usr\/bin\/python3m \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f python \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435: $ python &#8212;version Python 2.7.8 \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u2026 <span class=\"read-more\"><a href=\"https:\/\/netspider.com.ua\/index.php\/2020\/10\/17\/alternativnyj-python\/\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 &raquo;<\/a><\/span>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1786","post","type-post","status-publish","format-standard","hentry","category-main"],"_links":{"self":[{"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/posts\/1786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/comments?post=1786"}],"version-history":[{"count":4,"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/posts\/1786\/revisions"}],"predecessor-version":[{"id":1791,"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/posts\/1786\/revisions\/1791"}],"wp:attachment":[{"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/media?parent=1786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/categories?post=1786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/tags?post=1786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}