在OpenShift应用程序中安装软件包时,我应该使用pip-install还是sudo-pip install



复制的步骤

方法#1

rhc ssh my_app_name
pip install bottle-cork

方法#2

rhc ssh my_app_name
source ~/python/virtenv/bin/activate
pip install bottle-cork

方法#3

bottle-cork添加到requirements.txt

方法#4

install_requires=['bottle-cork']添加到setup.py

方法1和方法2产生了一长串错误。

官方文件中提出了方法3和4,并造成了多个错误和警告。

我很想尝试sudo pip install,但我知道这有时会导致权限问题和不一致(请参阅针对sudo pip的一般警告)。

问题

01)在OpenShift中安装软件包时,使用pip installsudo pip install是最佳做法吗?

02)执行pip install时,您是否应该在virtualenv中,即:

source ~/python/virtenv/bin/activate

03)或者您应该使用以下选项之一:

  • bottle-cork添加到requirements.txt
  • install_requires=['bottle-cork']添加到setup.py

#1和#2进近错误

注:*******代表用户id。

The directory '/var/lib/openshift/*******/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 7.1.0, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The directory '/var/lib/openshift/*******/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting bottle-cork
Downloading bottle-cork-0.12.0.tar.gz (108kB)
100% |????????????????????????????????| 110kB 3.5MB/s 
Collecting Bottle (from bottle-cork)
Downloading bottle-0.12.9.tar.gz (69kB)
100% |????????????????????????????????| 69kB 3.2MB/s 
Collecting pycrypto (from bottle-cork)
Downloading pycrypto-2.6.1.tar.gz (446kB)
100% |????????????????????????????????| 446kB 956kB/s 
Building wheels for collected packages: bottle-cork, Bottle, pycrypto
Exception:
Traceback (most recent call last):
File "/var/lib/openshift/*******/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/var/lib/openshift/*******/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/commands/install.py", line 293, in run
wb.build(autobuilding=True)
File "/var/lib/openshift/*******/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/wheel.py", line 756, in build
ensure_dir(output_dir)
File "/var/lib/openshift/*******/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/utils/__init__.py", line 70, in ensure_dir
os.makedirs(path)
File "/var/lib/openshift/*******/python/virtenv/lib64/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/var/lib/openshift/*******/python/virtenv/lib64/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/var/lib/openshift/*******/python/virtenv/lib64/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/var/lib/openshift/*******/python/virtenv/lib64/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/var/lib/openshift/*******/python/virtenv/lib64/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/var/lib/openshift/*******/python/virtenv/lib64/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/var/lib/openshift/*******/python/virtenv/lib64/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/lib/openshift/*******/.cache'

#3进近错误

我尝试根据这个OpenShift文档将bottle-cork添加到requirements.txt,然后推送并重新启动。在再次登录并运行pip freeze之后,我看不到bottle-cork。数字推送过程中显示的错误如下所示:

remote: Checking for pip dependency listed in requirements.txt file..
remote: The directory '/var/lib/openshift/*******/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
remote: You are using pip version 7.1.0, however version 8.1.2 is available.
remote: You should consider upgrading via the 'pip install --upgrade pip' command.
remote: The directory '/var/lib/openshift/*******/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
remote: Collecting bottle-cork (from -r /var/lib/openshift/*******/app-root/runtime/repo/requirements.txt (line 1))
remote:   The repository located at mirror1.ops.rhcloud.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host mirror1.ops.rhcloud.com'.
remote:   Could not find a version that satisfies the requirement bottle-cork (from -r /var/lib/openshift/*******/app-root/runtime/repo/requirements.txt (line 1)) (from versions: )
remote: No matching distribution found for bottle-cork (from -r /var/lib/openshift/*******/app-root/runtime/repo/requirements.txt (line 1))

#4进近错误

我尝试根据这个OpenShift文档将install_requires=['bottle-cork']添加到setup.py,然后推送并重新启动。在再次登录并运行pip freeze之后,我可以看到bottle-cork。然而,在git推送过程中出现了多个警告和错误:

remote: Processing dependencies for YourAppName==1.0
remote: Searching for bottle-cork
remote: Reading http://mirror1.ops.rhcloud.com/mirror/python/web/simple/bottle-cork/
remote: Best match: bottle-cork 0.12.0
remote: Downloading http://mirror1.ops.rhcloud.com/mirror/python/web/packages/source/b/bottle-cork/bottle-cork-0.12.0.tar.gz#md5=dfb94beb8038b22e07a1876cad464a23
remote: Processing bottle-cork-0.12.0.tar.gz
remote: Writing /tmp/easy_install-eAzgu8/bottle-cork-0.12.0/setup.cfg
remote: Running bottle-cork-0.12.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-eAzgu8/bottle-cork-0.12.0/egg-dist-tmp-KleNYn
remote: zip_safe flag not set; analyzing archive contents...
remote: Moving bottle_cork-0.12.0-py2.7.egg to /var/lib/openshift/*******/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages
remote: Adding bottle-cork 0.12.0 to easy-install.pth file
remote: 
remote: Installed /var/lib/openshift/*******/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/bottle_cork-0.12.0-py2.7.egg
remote: Searching for pycrypto
remote: Reading http://mirror1.ops.rhcloud.com/mirror/python/web/simple/pycrypto/
remote: Best match: pycrypto 2.6.1
remote: Downloading http://mirror1.ops.rhcloud.com/mirror/python/web/packages/source/p/pycrypto/pycrypto-2.6.1.tar.gz#md5=55a61a054aa66812daf5161a0d5d7eda
remote: Processing pycrypto-2.6.1.tar.gz
remote: Writing /tmp/easy_install-3HiFoD/pycrypto-2.6.1/setup.cfg
remote: Running pycrypto-2.6.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-3HiFoD/pycrypto-2.6.1/egg-dist-tmp-dPyoQF
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/_fastmath.c:31:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/stdio.h:28,
remote:                  from src/_fastmath.c:29:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/_fastmath.c:31:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/stdio.h:28,
remote:                  from src/_fastmath.c:29:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/MD2.c:31:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/string.h:27,
remote:                  from src/MD2.c:30:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/MD2.c:31:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/string.h:27,
remote:                  from src/MD2.c:30:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/MD4.c:31:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/string.h:27,
remote:                  from src/MD4.c:30:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/MD4.c:31:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/string.h:27,
remote:                  from src/MD4.c:30:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/hash_SHA2_template.c:33,
remote:                  from src/SHA256.c:72:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/hash_SHA2.h:72,
remote:                  from src/SHA256.c:35:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/hash_SHA2_template.c:33,
remote:                  from src/SHA256.c:72:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/hash_SHA2.h:72,
remote:                  from src/SHA256.c:35:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/hash_SHA2_template.c:33,
remote:                  from src/SHA224.c:73:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/hash_SHA2.h:72,
remote:                  from src/SHA224.c:36:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/hash_SHA2_template.c:33,
remote:                  from src/SHA224.c:73:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/hash_SHA2.h:72,
remote:                  from src/SHA224.c:36:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/hash_SHA2_template.c:33,
remote:                  from src/SHA384.c:80:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/hash_SHA2.h:72,
remote:                  from src/SHA384.c:36:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/hash_SHA2_template.c:33,
remote:                  from src/SHA384.c:80:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/hash_SHA2.h:72,
remote:                  from src/SHA384.c:36:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/hash_SHA2_template.c:33,
remote:                  from src/SHA512.c:80:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/hash_SHA2.h:72,
remote:                  from src/SHA512.c:36:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/hash_SHA2_template.c:33,
remote:                  from src/SHA512.c:80:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/hash_SHA2.h:72,
remote:                  from src/SHA512.c:36:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/RIPEMD160.c:57:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/RIPEMD160.c:48:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/RIPEMD160.c:57:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/RIPEMD160.c:48:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/AES.c:29:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/assert.h:37,
remote:                  from src/AES.c:27:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/AES.c:29:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/assert.h:37,
remote:                  from src/AES.c:27:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/ARC2.c:45:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/string.h:27,
remote:                  from src/ARC2.c:44:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/ARC2.c:45:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/string.h:27,
remote:                  from src/ARC2.c:44:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/Blowfish.c:39:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/Blowfish.c:31:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/Blowfish.c:39:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/stdint.h:26,
remote:                  from src/Blowfish.c:31:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/DES.c:37:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/assert.h:37,
remote:                  from src/libtom/tomcrypt.h:3,
remote:                  from src/libtom/tomcrypt_des.c:11,
remote:                  from src/DES.c:32:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/DES.c:37:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/assert.h:37,
remote:                  from src/libtom/tomcrypt.h:3,
remote:                  from src/libtom/tomcrypt_des.c:11,
remote:                  from src/DES.c:32:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/DES.c:37,
remote:                  from src/DES3.c:26:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/assert.h:37,
remote:                  from src/libtom/tomcrypt.h:3,
remote:                  from src/libtom/tomcrypt_des.c:11,
remote:                  from src/DES.c:32,
remote:                  from src/DES3.c:26:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/DES.c:37,
remote:                  from src/DES3.c:26:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/assert.h:37,
remote:                  from src/libtom/tomcrypt.h:3,
remote:                  from src/libtom/tomcrypt_des.c:11,
remote:                  from src/DES.c:32,
remote:                  from src/DES3.c:26:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/_counter.c:28:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1191:1: warning: "_POSIX_C_SOURCE" redefined
remote: In file included from /usr/include/assert.h:37,
remote:                  from src/_counter.c:25:
remote: /usr/include/features.h:162:1: warning: this is the location of the previous definition
remote: In file included from /opt/rh/python27/root/usr/include/python2.7/pyconfig.h:6,
remote:                  from /opt/rh/python27/root/usr/include/python2.7/Python.h:8,
remote:                  from src/_counter.c:28:
remote: /opt/rh/python27/root/usr/include/python2.7/pyconfig-64.h:1213:1: warning: "_XOPEN_SOURCE" redefined
remote: In file included from /usr/include/assert.h:37,
remote:                  from src/_counter.c:25:
remote: /usr/include/features.h:164:1: warning: this is the location of the previous definition
remote: zip_safe flag not set; analyzing archive contents...
remote: Moving pycrypto-2.6.1-py2.7-linux-x86_64.egg to /var/lib/openshift/*******/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages
remote: Adding pycrypto 2.6.1 to easy-install.pth file
remote: 
remote: Installed /var/lib/openshift/*******/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pycrypto-2.6.1-py2.7-linux-x86_64.egg
remote: Searching for Bottle
remote: Best match: bottle cork-0.12.0
remote: Downloading http://mirror1.ops.rhcloud.com/mirror/python/web/packages/source/b/bottle-cork/bottle-cork-0.12.0.tar.gz#md5=dfb94beb8038b22e07a1876cad464a23
remote: Processing bottle-cork-0.12.0.tar.gz
remote: Writing /tmp/easy_install-8wwl3n/bottle-cork-0.12.0/setup.cfg
remote: Running bottle-cork-0.12.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-8wwl3n/bottle-cork-0.12.0/egg-dist-tmp-ZrFuqW
remote: zip_safe flag not set; analyzing archive contents...
remote: Removing /var/lib/openshift/*******/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/bottle_cork-0.12.0-py2.7.egg
remote: Moving bottle_cork-0.12.0-py2.7.egg to /var/lib/openshift/*******/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages
remote: bottle-cork 0.12.0 is already the active version in easy-install.pth
remote: 
remote: Installed /var/lib/openshift/*******/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/bottle_cork-0.12.0-py2.7.egg
remote: error: The 'Bottle' distribution was not found and is required by bottle-cork

在OpenShift中使用pip安装依赖项需要特定的过程,而sudo并不是一个真正的选项。这包括使用requirements.txtsetup.py文件(两者都可以同时使用,尽管任何冲突都需要手动解决)。

请参阅部署指南和管理应用程序包相关性-步骤3。很明显,您已经尝试了许多不同的方法来使事情正常工作,尽管在没有看到requirements.txtsetup.py文件的情况下,还不完全清楚问题出在哪里。

最新更新