./configure not working when installing python 3.6.1

I installed python 3.6.1 from python.org and extracted the file. Then I did:

cd Desktop
cd Python-3.6.1
./configure

But then I got an error:

./configure: line 2328 config.log: Permission denied
./configure: line 2338 config.log: Permission denied

What can I do to fix this?


You've done some stuff with the Python 3.6.1 source code bundle as super-user and now the file ownership is screwed up. Typically there's no need to build a source code bundle as super-user. The subsequent installation (i. e. make install or checkinstall) may require super-user privileges if you want to install the software in a system location.

To re-transfer the file ownership to yourself run:

sudo chown -R "$USER:" ~/Desktop/Python-3.6.1