1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import os
- import sys
- from distutils.sysconfig import get_python_lib
- from setuptools import setup
- overlay_warning = False
- if "install" in sys.argv:
- lib_paths = [get_python_lib()]
- if lib_paths[0].startswith("/usr/lib/"):
-
-
- lib_paths.append(get_python_lib(prefix="/usr/local"))
- for lib_path in lib_paths:
- existing_path = os.path.abspath(os.path.join(lib_path, "django"))
- if os.path.exists(existing_path):
-
-
- overlay_warning = True
- break
- setup()
- if overlay_warning:
- sys.stderr.write("""
- ========
- WARNING!
- ========
- You have just installed Django over top of an existing
- installation, without removing it first. Because of this,
- your install may now include extraneous files from a
- previous version that have since been removed from
- Django. This is known to cause a variety of problems. You
- should manually remove the
- %(existing_path)s
- directory and re-install Django.
- """ % {"existing_path": existing_path})
|