簡體   English   中英

OpenShift Django項目部署失敗:“錯誤:無法在安裝目錄中創建或刪除文件”

[英]OpenShift Django project deployment fails: “error: can't create or remove files in install directory”

長時間不活動后,我正在更新項目,但出現了問題。 部署失敗,並且在git push之后應用程序未重新啟動。

我仍然可以通過運行gear start手動啟動我的應用程序,但是從install_requires安裝軟件包所需的部署步驟失敗。

以下是gear deploy輸出的部分:

Activating virtenv
Running setup.py script..
running develop
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/lib/python2.6/site-packages/test-easy-install-358943.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/lib/python2.6/site-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  http://peak.telecommunity.com/EasyInstall.html

Please make the appropriate changes for your system and try again.

然后:

Running collectstatic...
Traceback (most recent call last):
  File "~/app-root/runtime/repo//wsgi/music/manage.py", line 2, in <module>
    from django.core.management import execute_manager
ImportError: No module named django.core.management

我嘗試啟用venv並手動運行setup.py:

source $OPENSHIFT_GEAR_DIR/virtenv/bin/activate
export PYTHON_EGG_CACHE=$OPENSHIFT_GEAR_DIR/virtenv/lib/python-2.6
~/app-root/repo/setup.py develop

但是,它導致同樣can't create or remove files in install directory錯誤。 而且,我也無法像之前那樣在這種環境中運行manage.py

在我看來,venv出了點問題,但是, gear start使用了它,但它仍然有效...

有人可以給我介紹這個問題的重點嗎?

PS我正在使用Python 2.6墨盒

至少,我已經開始工作了。 符號鏈接混亂, virtenv/lib64 > ../../python-2.6/virtenv/lib僅可從~/python-2.6 ,這是~/python的符號鏈接,其中包含virtenv ,實際上已被引用通過環境變量,這是指向~/app-root/runtime/dependencies/python/virtenv另一個符號鏈接。 結果,virtenv python解釋器無法在virtenv/lib64找到庫和其他內容,並且回退到/usr前綴。

我只是指出lib64 > lib和deploy現在可以使用了。

但是,所有這些混亂都是由OpenShift工具鏈造成的,我不確定它不會再次崩潰。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM