Question

I am hosting django-1.5 app on openshift. I need django-registration module which I have specified in requirements.txt file.

The problem is that openshift is not able to find latest version django-registration-1.0 but only django-registration-0.8 which is not compatible with django-1.5 Any idea how to resolve this or how to add manual link to latest version in requirements.txt?

I'm not getting why its not able to find package while it is available at PyPI.

remote: Searching for django-registration==1.0
remote: Reading http://mirror1.ops.rhcloud.com/mirror/python/web/simple/django-registration/
remote: Reading http://www.bitbucket.org/ubernostrum/django-registration/wiki/
remote: Reading <some other link>
remote: Reading <some other link>
remote: Reading <Some Other link>
remote: No local packages or download links found for django-registration==1.0
remote: Best match: None
Was it helpful?

Solution

I made it work using setuptools specifying dependency link, though why PyPI package is not working is still not clear to me.

from setuptools import setup, find_packages

setup(
    ...
    ...
    packages=find_packages(),
    include_package_data=True,
    install_requires=['django-registration==1.0'],
    dependency_links = [
        "http://pypi.python.org/pypi/django-registration"
    ],

)

OTHER TIPS

How about directly installing package by logging into the application gear via ssh and running:

source ~/python-2.6/virtenv/bin/activate
pip install --log $OPENSHIFT_DATA_DIR/inst.log https://URL_TO_CUSTOM_PACKAGE

OR

source ~/python-2.6/virtenv/bin/activate
pip install --log $OPENSHIFT_DATA_DIR/inst.log -E $VIRTUAL_ENV  $path_to/package   

Since the issue is still alive (argh!) and I couldn't install the last security release for django I had to find a workaround for this problem. Inserting the following line to the top of the requirements.txt magically solved the problem:

--index-url https://pypi.python.org/simple

It just sets the base url for finding packages.

I know that the question is a bit old, but I had a similar problem with OpenShift. On PyPi the package wagtail had the latest version of 1.4.1, but on OpenShift only 1.3.1 was found. After git push it show an url in the output, which seemed to point to a mirror instead os the pypi.python.org.

I logged in the app and: env | grep -i pypi OPENSHIFT_PYPI_MIRROR_URL=http://mirror1.ops.rhcloud.com/mirror/python/web/simple

It seems that OpenShift by default uses it's own mirror for Python packages. A mirror that is a bit out of date. I don't know why. I can't really say whether it is better to do as tomako suggests or could the change be made to the env variable OPENSHIFT_PYPI_MIRROR_URL or how often the mirror is updated.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top