diff -r 475bb98ae813 Lib/packaging/install.py --- a/Lib/packaging/install.py Thu Jun 02 16:43:25 2011 +0200 +++ b/Lib/packaging/install.py Thu Jun 02 22:02:13 2011 +0200 @@ -492,6 +492,8 @@ purelib_path = get_path('purelib') # trying to write a file there try: + if not os.path.exists(purelib_path): + os.makedirs(purelib_path) with tempfile.NamedTemporaryFile(suffix=project, dir=purelib_path) as testfile: testfile.write(b'test')