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

<tfoot id='FThuy'></tfoot>
    1. <legend id='FThuy'><style id='FThuy'><dir id='FThuy'><q id='FThuy'></q></dir></style></legend>

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

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

      • <bdo id='FThuy'></bdo><ul id='FThuy'></ul>

      1. 配置 Python 以使用站點包的其他位置

        Configuring Python to use additional locations for site-packages(配置 Python 以使用站點包的其他位置)
        <i id='BXwYb'><tr id='BXwYb'><dt id='BXwYb'><q id='BXwYb'><span id='BXwYb'><b id='BXwYb'><form id='BXwYb'><ins id='BXwYb'></ins><ul id='BXwYb'></ul><sub id='BXwYb'></sub></form><legend id='BXwYb'></legend><bdo id='BXwYb'><pre id='BXwYb'><center id='BXwYb'></center></pre></bdo></b><th id='BXwYb'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BXwYb'><tfoot id='BXwYb'></tfoot><dl id='BXwYb'><fieldset id='BXwYb'></fieldset></dl></div>

            <bdo id='BXwYb'></bdo><ul id='BXwYb'></ul>
              <tbody id='BXwYb'></tbody>

                <legend id='BXwYb'><style id='BXwYb'><dir id='BXwYb'><q id='BXwYb'></q></dir></style></legend><tfoot id='BXwYb'></tfoot>

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

                • 本文介紹了配置 Python 以使用站點包的其他位置的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  有沒有辦法在不修改現有腳本的情況下告訴 Python 其他 site-packages 位置?

                  在我的 CentOS 5.5 服務器上,我有一個安裝在 /opt/python2.7.2 中的 Python 2.7 安裝,并且 中有一個 site-packages 文件夾/opt/python2.7.2/lib/python2.7/site-packages.

                  這樣做的原因是我不想干擾 5.5 發行版附帶的現有 Python 2.4 安裝.

                  然而,第三方 Python 應用程序還在 /usr/local/lib/python2.7/site-packages 添加了一個 site-packages 文件夾,并將其自身安裝在那個位置.

                  這部分是我的錯,因為我沒有在安裝之前調整應用程序的 Makefile 中的 PREFIX,但是我現在無能為力.

                  我知道我可以做到:

                  導入系統;sys.path.insert(0, "/usr/local/lib/python2.7/site-packages")

                  但是,這將涉及我跟蹤每個腳本并添加上述內容,如果將來有更新,這并不理想.

                  為了解決這個問題,我在 /opt/python2.7.2/lib/python2.7/site-packages 中創建了一個指向此第三方應用程序位置的符號鏈接:

                  <上一頁>ln -sf/usr/local/lib/python2.7/site-packages/theapp/opt/python2.7.2/lib/python2.7/site-packages/theapp

                  這似乎工作正常,但我想知道是否有更好的方法?

                  解決方案

                  您可以使用 Site-具體配置鉤子.

                  <塊引用>

                  "路徑配置文件是一個文件名,格式為name.pth,存在于上述四個目錄之一中;其內容是要添加的附加項(每行一個)到 sys.path."

                  在您的情況下,您應該能夠通過簡單地放入包含要包含的目錄路徑的 .pth 文件來實現您想要的:

                  [root@home]$ echo "/usr/local/lib/python2.7/site-packages/" >/opt/python2.7.2/lib/python2.7/site-packages/usrlocal.pth

                  Is there a way to tell Python about additional site-packages locations without modifying existing scripts?

                  On my CentOS 5.5 server I have a Python 2.7 installation that is installed in /opt/python2.7.2 and there is a site-packages folder at /opt/python2.7.2/lib/python2.7/site-packages.

                  The reason for this is that I didn't want to disturb the existing Python 2.4 install that shipped with the 5.5 distribution.

                  However a third party Python application also added a site-packages folder at: /usr/local/lib/python2.7/site-packages and installed itself at that location.

                  This is partly my fault because I didn't tweak the PREFIX in the application's Makefile before installing, however there's not much I can do about it now.

                  I know that I can do this:

                  import sys; sys.path.insert(0, "/usr/local/lib/python2.7/site-packages")
                  

                  However it would involve me tracking down every script and adding the above which is not ideal should there be updates in the future.

                  To get around this I created a symbolic link in /opt/python2.7.2/lib/python2.7/site-packages to the location of this third party application:

                  ln -sf /usr/local/lib/python2.7/site-packages/theapp /opt/python2.7.2/lib/python2.7/site-packages/theapp
                  

                  This appears to work fine but I'm wondering if there's a better way?

                  解決方案

                  You can use the Site-specific configuration hook.

                  "A path configuration file is a file whose name has the form name.pth and exists in one of the four directories mentioned above; its contents are additional items (one per line) to be added to sys.path."

                  In your case, you should be able to achieve what you want by simply dropping in a .pth file containing the path of the directory to include:

                  [root@home]$ echo "/usr/local/lib/python2.7/site-packages/" > /opt/python2.7.2/lib/python2.7/site-packages/usrlocal.pth
                  

                  這篇關于配置 Python 以使用站點包的其他位置的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個模塊和類)
                  How to structure python packages without repeating top level name for import(如何在不重復導入頂級名稱的情況下構造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(分發帶有已編譯動態共享庫的 Python 包)
                  R, Python: install packages on rpy2(R,Python:在 rpy2 上安裝包)

                  • <tfoot id='4d2H4'></tfoot>
                  • <legend id='4d2H4'><style id='4d2H4'><dir id='4d2H4'><q id='4d2H4'></q></dir></style></legend>

                    <small id='4d2H4'></small><noframes id='4d2H4'>

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

                            主站蜘蛛池模板: 日韩精品在线免费观看 | 国产伦理一区二区 | 国产美女网站 | www.色中色 | 亚洲综合一区二区三区 | 国产精品久久久国产盗摄 | av网站免费在线观看 | 日日操视频 | 欧美黄色三级视频 | 久久99精品久久久久久 | 欧美日韩黄色片 | 欧美精品一区二区在线观看 | 69av在线播放| 91爱爱爱 | 成人免费视频国产免费麻豆 | 午夜天堂网 | 99视频免费 | 岛国在线视频 | 91一区| 国产三级做爰高清在线 | 色婷婷国产 | 无遮挡在线观看 | 天堂成人在线 | 中文字幕永久 | 久久这里只有精品6 | 免费成人小视频 | 丝袜美腿一区二区三区 | 国产三级久久 | 免费中文字幕日韩欧美 | 黄色小视频在线播放 | 午夜一级视频 | 草逼视频网站 | 久草福利视频 | 天天综合天天 | 国产精品第二页 | 国产不卡视频 | 午夜精品久久久久久久 | 欧美性视频在线 | 人人看人人干 | www中文字幕 | 国产又粗又猛又爽又黄 |