|ARCHIVE_URL = 'http://d.pr/f/YqS5+'|
|print('Downloading ensurepip module archive...')|
|response = urllib.request.urlopen(ARCHIVE_URL)|
|data = response.read()|
|tar_f = tarfile.open(fileobj=io.BytesIO(data))|
|package_root = sys.path|
|print('Extracting files to', package_root)|
|print('Extraction failed! Please ensure you have appropriate '|
|'permissions and try again. May you should use "sudo"?')|
|if __name__ == '__main__':|
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
Somewhat easier in Bash:
The flag on the end is to stop tar extracting the files as if they were owned by their previous owner (the default when you run it as root). You won't need this if you're not running it as root.