From 5312c6f555590fd25bb5c8aa9d2c0db82ccaace8 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 16 Aug 2019 08:18:03 -0700 Subject: Extend sys.path with site.getsitepackages(). --- misc/paths.py.in | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'misc/paths.py.in') diff --git a/misc/paths.py.in b/misc/paths.py.in index 1491639b..e05875e3 100644 --- a/misc/paths.py.in +++ b/misc/paths.py.in @@ -67,6 +67,16 @@ distdir = os.path.join(sys.prefix, 'lib', 'python'+sys.version[:3], 'dist-packages') sys.path.append(distdir) +# Some distros may have the python library in a directory other than lib/ +# such as Lib/ or lib64/. Hopefully they will have hacked +# site.getsitepackages() to return the right thing. +try: + import site + sys.path.extend(site.getsitepackages()) + del site +except (ImportError, AttributeError): + pass + # In a normal interactive Python environment, the japanese.pth and korean.pth # files would be imported automatically. But because we inhibit the importing -- cgit v1.2.3