Search code examples
python-2.7pipopenshiftpython-cffi

openshift python pip install cffi fails


When the application is deployed after git push to openshift repo I get an error when requirements.txt is start to installing.

The thing is, in my local machine there is not issue when I execute pip install cffi

remote: Requirement already satisfied (use --upgrade to upgrade): aniso8601==0.92 in /var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 1))
remote: Downloading/unpacking apns-client==0.2.1 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 2))
remote:   Downloading apns-client-0.2.1.tar.gz
remote:   Running setup.py egg_info for package apns-client
remote:     
remote: Downloading/unpacking cffi==0.9.2 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 3))
remote:   Could not find a version that satisfies the requirement cffi==0.9.2 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 3)) (from versions: 0.1, 0.2.1, 0.2, 0.3, 0.4.1, 0.4.2, 0.4, 0.5, 0.6, 0.7.1, 0.7.2, 0.7, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8)
remote: Cleaning up...
remote: No distributions matching the version for cffi==0.9.2 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 3))
remote: Traceback (most recent call last):
remote:   File "/var/lib/openshift/myuser/python/virtenv/bin/pip", line 12, in <module>
remote:     load_entry_point('pip==1.4', 'console_scripts', 'pip')()
remote:   File "/var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/__init__.py", line 147, in main
remote:     return command.main(args[1:], options)
remote:   File "/var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 171, in main
remote:     log_fp = open_logfile(log_fn, 'w')
remote:   File "/var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 200, in open_logfile
remote:     os.makedirs(dirname)
remote:   File "/var/lib/openshift/myuser/python/virtenv/lib64/python2.7/os.py", line 157, in makedirs
remote:     mkdir(name, mode)
remote: OSError: [Errno 13] Permission denied: '/var/lib/openshift/myuser/.pip'

The same thing happens with pip isntall cryptography and pyOpenSSL


Solution

  • I finally fix it. Connecting through ssh

    rhc ssh -a myapp
    

    Once I have connected I used pip as usual

    pip install cffi
    pip install cryptography
    pip install pyOpenSSL