久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  1. <legend id='lymIH'><style id='lymIH'><dir id='lymIH'><q id='lymIH'></q></dir></style></legend>
    <i id='lymIH'><tr id='lymIH'><dt id='lymIH'><q id='lymIH'><span id='lymIH'><b id='lymIH'><form id='lymIH'><ins id='lymIH'></ins><ul id='lymIH'></ul><sub id='lymIH'></sub></form><legend id='lymIH'></legend><bdo id='lymIH'><pre id='lymIH'><center id='lymIH'></center></pre></bdo></b><th id='lymIH'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='lymIH'><tfoot id='lymIH'></tfoot><dl id='lymIH'><fieldset id='lymIH'></fieldset></dl></div>
      • <bdo id='lymIH'></bdo><ul id='lymIH'></ul>

      <tfoot id='lymIH'></tfoot>
    1. <small id='lymIH'></small><noframes id='lymIH'>

      升級python而不破壞yum

      Upgrade python without breaking yum(升級python而不破壞yum)
    2. <tfoot id='5wbo2'></tfoot>
        <bdo id='5wbo2'></bdo><ul id='5wbo2'></ul>
        1. <small id='5wbo2'></small><noframes id='5wbo2'>

          <legend id='5wbo2'><style id='5wbo2'><dir id='5wbo2'><q id='5wbo2'></q></dir></style></legend>

                <tbody id='5wbo2'></tbody>
              <i id='5wbo2'><tr id='5wbo2'><dt id='5wbo2'><q id='5wbo2'><span id='5wbo2'><b id='5wbo2'><form id='5wbo2'><ins id='5wbo2'></ins><ul id='5wbo2'></ul><sub id='5wbo2'></sub></form><legend id='5wbo2'></legend><bdo id='5wbo2'><pre id='5wbo2'><center id='5wbo2'></center></pre></bdo></b><th id='5wbo2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5wbo2'><tfoot id='5wbo2'></tfoot><dl id='5wbo2'><fieldset id='5wbo2'></fieldset></dl></div>

                本文介紹了升級python而不破壞yum的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我最近通過從源代碼編譯在 CentOS 機(jī)器上安裝了 Python 2.7.3.Python 2.7.3 安裝在/opt/python2.7 中,當(dāng)我安裝它時,我只是將/usr/bin/python 更改為指向新版本.這顯然是錯誤的,因為當(dāng)我這樣做時它打破了百勝.我會得到以下內(nèi)容.

                I recently installed Python 2.7.3 on a CentOS machine by compiling from source. Python 2.7.3 is installed at /opt/python2.7 and when I installed it I just changed /usr/bin/python to point to the new version. This apparently is wrong though because when I did it it broke yum. I would get the following.

                There was a problem importing one of the Python modules
                required to run yum. The error leading to this problem was:
                
                   No module named yum
                
                Please install a package which provides this module, or
                verify that the module is installed correctly.
                
                It's possible that the above module doesn't match the
                current version of Python, which is:
                2.7.3 (default, May 15 2012, 17:45:42) 
                [GCC 4.4.4 20100726 (Red Hat 4.4.4-13)]
                
                If you cannot solve this problem yourself, please go to 
                the yum faq at:
                  http://yum.baseurl.org/wiki/Faq
                

                我將/usr/bin/python 更改為指向 python 2.6.6,但現(xiàn)在 2.6.6 是 python 的默認(rèn)版本.知道如何解決這個問題嗎?

                I changed /usr/bin/python to point back to the python 2.6.6 but now 2.6.6 is the default version of python. Any idea how to fix this?

                推薦答案

                我寫了一個快速指南關(guān)于如何在 CentOS 6 和 CentOS 7 上安裝最新版本的 Python 2 和 Python 3.它目前涵蓋 Python 2.7.13 和 Python 3.6.0:

                I have written a quick guide on how to install the latest versions of Python 2 and Python 3 on CentOS 6 and CentOS 7. It currently covers Python 2.7.13 and Python 3.6.0:

                # Start by making sure your system is up-to-date:
                yum update
                # Compilers and related tools:
                yum groupinstall -y "development tools"
                # Libraries needed during compilation to enable all features of Python:
                yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel expat-devel
                # If you are on a clean "minimal" install of CentOS you also need the wget tool:
                yum install -y wget
                

                接下來的步驟取決于您安裝的 Python 版本.

                The next steps depend on the version of Python you're installing.

                對于 Python 2.7.14:

                For Python 2.7.14:

                wget http://python.org/ftp/python/2.7.14/Python-2.7.14.tar.xz
                tar xf Python-2.7.14.tar.xz
                cd Python-2.7.14
                ./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
                make && make altinstall
                
                # Strip the Python 2.7 binary:
                strip /usr/local/lib/libpython2.7.so.1.0
                

                對于 Python 3.6.3:

                For Python 3.6.3:

                wget http://python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
                tar xf Python-3.6.3.tar.xz
                cd Python-3.6.3
                ./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
                make && make altinstall
                
                # Strip the Python 3.6 binary:
                strip /usr/local/lib/libpython3.6m.so.1.0
                

                要安裝 Pip:

                # First get the script:
                wget https://bootstrap.pypa.io/get-pip.py
                
                # Then execute it using Python 2.7 and/or Python 3.6:
                python2.7 get-pip.py
                python3.6 get-pip.py
                
                # With pip installed you can now do things like this:
                pip2.7 install [packagename]
                pip2.7 install --upgrade [packagename]
                pip2.7 uninstall [packagename]
                

                您不應(yīng)該更改 Python 的系統(tǒng)版本,因為它會破壞系統(tǒng)(正如您所發(fā)現(xiàn)的).只要您不理會原始系統(tǒng)版本,安裝其他版本就可以正常工作.這可以通過在運行 configure 時使用自定義前綴(例如 /usr/local)和使用 make altinstall(而不是普通的 make install) 安裝您的 Python 版本時.

                You are not supposed to change the system version of Python because it will break the system (as you found out). Installing other versions works fine as long as you leave the original system version alone. This can be accomplished by using a custom prefix (for example /usr/local) when running configure, and using make altinstall (instead of the normal make install) when installing your build of Python.

                只要您記得輸入包含版本號的全名(例如python2.7"或pip2.7"),擁有多個可用的 Python 版本通常不是什么大問題.如果您從 virtualenv 完成所有 Python 工作,則版本控制會為您處理,因此請確保您安裝并使用 virtualenv!

                Having multiple versions of Python available is usually not a big problem as long as you remember to type the full name including the version number (for example "python2.7" or "pip2.7"). If you do all your Python work from a virtualenv the versioning is handled for you, so make sure you install and use virtualenv!

                這篇關(guān)于升級python而不破壞yum的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個模塊和類)
                Configuring Python to use additional locations for site-packages(配置 Python 以使用站點包的其他位置)
                How to structure python packages without repeating top level name for import(如何在不重復(fù)導(dǎo)入頂級名稱的情況下構(gòu)造python包)
                Install python packages on OpenShift(在 OpenShift 上安裝 python 包)
                How to refresh sys.path?(如何刷新 sys.path?)
                Distribute a Python package with a compiled dynamic shared library(分發(fā)帶有已編譯動態(tài)共享庫的 Python 包)
                  <bdo id='at1Ll'></bdo><ul id='at1Ll'></ul>
                  1. <i id='at1Ll'><tr id='at1Ll'><dt id='at1Ll'><q id='at1Ll'><span id='at1Ll'><b id='at1Ll'><form id='at1Ll'><ins id='at1Ll'></ins><ul id='at1Ll'></ul><sub id='at1Ll'></sub></form><legend id='at1Ll'></legend><bdo id='at1Ll'><pre id='at1Ll'><center id='at1Ll'></center></pre></bdo></b><th id='at1Ll'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='at1Ll'><tfoot id='at1Ll'></tfoot><dl id='at1Ll'><fieldset id='at1Ll'></fieldset></dl></div>

                    <tfoot id='at1Ll'></tfoot>

                      <legend id='at1Ll'><style id='at1Ll'><dir id='at1Ll'><q id='at1Ll'></q></dir></style></legend>
                        <tbody id='at1Ll'></tbody>

                      <small id='at1Ll'></small><noframes id='at1Ll'>

                        • 主站蜘蛛池模板: 噜啊噜在线 | 精品国产乱码久久久久久蜜退臀 | 成人免费视频网站在线看 | 欧美日韩一区精品 | 久热电影 | 男人天堂久久 | 福利视频一区二区 | 福利网站在线观看 | 国产午夜在线观看 | 99热在线观看精品 | 国产一级特黄真人毛片 | 欧美日韩高清一区二区三区 | 日韩国产精品一区二区三区 | 亚洲成人av一区二区 | 女生羞羞视频 | 亚洲网站在线观看 | 91久久精品国产 | 国产精品一区久久久久 | caoporn视频在线 | 欧美一区二区大片 | 欧美亚洲国产日韩 | 一区二区三区四区国产 | 九九色九九 | 一区二区三区四区在线播放 | 精品国产精品国产偷麻豆 | 视频在线一区 | 91在线色视频 | 国产精品久久亚洲 | 中文字幕精品一区 | 成人一区av | 久久五月婷 | 久久免费精品 | 毛片免费在线 | 亚洲综合五月天婷婷 | av播播| 日韩视频一区二区在线 | wwww.xxxx免费| 在线免费观看成人 | 综合久久综合久久 | 国产精品夜色一区二区三区 | 在线婷婷|