Search code examples
pythondjangoapacheubuntubitnami

Error PYTHON_EGG_CACHE while uploading django


I am trying to upload my django project live and I am continuously getting this error:

pkg_resources.ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

[Errno 13] Permission denied: '/opt/bitnami/.tmp/simplejson-2.0.9-py2.7-linux-x86_64.egg-tmp/simplejson/tmpuYcIYB.$extract'

The Python egg cache directory is currently set to:

/opt/bitnami/.tmp

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

Solution

  • It is a permissions / ownership problem. You can solve it using these commands:

    sudo su bitnami sudo find /opt/bitnami/apps/django/ -type d -exec chmod 755 {} \; sudo find /opt/bitnami/apps/django/ -type f -exec chmod 644 {} \; sudo chown -R bitnami:daemon /opt/bitnami/apps/django/

    You must also deploy your projects to the following path: /opt/bitnami/apps/django/django_projects/YOURPROJECT