aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--changelog.d/1431.chnage.rst3
-rwxr-xr-xsetuptools/command/easy_install.py6
2 files changed, 9 insertions, 0 deletions
diff --git a/changelog.d/1431.chnage.rst b/changelog.d/1431.chnage.rst
new file mode 100644
index 00000000..a5cb324e
--- /dev/null
+++ b/changelog.d/1431.chnage.rst
@@ -0,0 +1,3 @@
+Make install directory if it doesn't exist yet to prevent Fedora's
+specific setup to blow up if ``/usr/local/lib/pythonX.Y/site-packages``
+doesn't exist yet.
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 05508ceb..5b65b95d 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -450,6 +450,12 @@ class easy_install(Command):
instdir = normalize_path(self.install_dir)
pth_file = os.path.join(instdir, 'easy-install.pth')
+ if not os.path.exists(instdir):
+ try:
+ os.makedirs(instdir)
+ except (OSError, IOError):
+ self.cant_write_to_target()
+
# Is it a configured, PYTHONPATH, implicit, or explicit site dir?
is_site_dir = instdir in self.all_site_dirs