Zulip Chat Archive

Stream: general

Topic: Installing python(mathlib)


view this post on Zulip Ashvni Narayanan (Nov 25 2019 at 21:44):

I'm having issues installing mathlib. I followed the instructions given here, https://github.com/leanprover-community/mathlib/blob/master/docs/install/windows.md
I copied python.exe to python3.exe, but when I run python3 --version in gitbash, it says permission denied.
What should I do?

view this post on Zulip Floris van Doorn (Nov 25 2019 at 21:45):

What directory is your copy of python3.exe located?

view this post on Zulip Floris van Doorn (Nov 25 2019 at 21:46):

It might be in a folder like C:\Program Files where you don't have permission to run files? Just guessing here.

view this post on Zulip Ashvni Narayanan (Nov 25 2019 at 21:47):

It might be in a folder like C:\Program Files where you don't have permission to run files? Just guessing here.

Seems like, yeah.

view this post on Zulip Floris van Doorn (Nov 25 2019 at 21:48):

What is the output of which python3?

view this post on Zulip Ashvni Narayanan (Nov 25 2019 at 21:49):

/c/Users/ashvn/AppData/Local/Microsoft/WindowsApps/python3

view this post on Zulip Floris van Doorn (Nov 25 2019 at 21:54):

You seem to run into this issue: https://stackoverflow.com/questions/56974927/permission-denied-trying-to-run-python-on-windows-10

view this post on Zulip Floris van Doorn (Nov 25 2019 at 21:54):

Can you try this

type "manage app execution aliases" into the Windows search prompt and disable the store versions of Python altogether.

and then try again?

view this post on Zulip Ashvni Narayanan (Nov 25 2019 at 21:57):

You mean reinstall the entire thing?

view this post on Zulip Floris van Doorn (Nov 25 2019 at 21:58):

no, after you have changed the two settings in manage app execution aliases, just type python3 --version in Git bash again.

view this post on Zulip Ashvni Narayanan (Nov 25 2019 at 22:01):

It says No such file or directory

view this post on Zulip Floris van Doorn (Nov 25 2019 at 22:02):

Does python --version give the same?
If so: you probably should add the folder where you installed python to your PATH.
If not, please repeat the step to copy python.exe to python3.exe: that step might have gone wrong because of the Windows thing.

view this post on Zulip Floris van Doorn (Nov 25 2019 at 22:06):

Actually, this might be something else: try closing and reopening Git Bash. It might still think that python3 is pointing to the wrong folder.

view this post on Zulip Floris van Doorn (Nov 25 2019 at 22:07):

Can you also give me the output of where python3 in Git Bash? (either before or after restarting it)

view this post on Zulip Ashvni Narayanan (Nov 25 2019 at 22:07):

Now it just says command not found

view this post on Zulip Ashvni Narayanan (Nov 25 2019 at 22:07):

INFO: Could not find files for the given pattern(s).

view this post on Zulip Floris van Doorn (Nov 25 2019 at 22:07):

ok... and python --version also gives command not found?

view this post on Zulip Ashvni Narayanan (Nov 25 2019 at 22:08):

ok... and python --version also gives command not found?

No, it gives
Python 3.8.0

view this post on Zulip Floris van Doorn (Nov 25 2019 at 22:09):

Ok, then repeat the step to copy python.exe to python3.exe, and continue from there.

view this post on Zulip Floris van Doorn (Nov 25 2019 at 22:12):

Let me know if it works now.
I will update the installation instructions.

view this post on Zulip Ashvni Narayanan (Nov 25 2019 at 22:13):

Sorry for the bad question, but what does copying the file to the file mean?

view this post on Zulip Floris van Doorn (Nov 25 2019 at 22:16):

if you're in the right folder, select (but do not open) the file python.exe, press ctrl+C ctrl+V to copy it, and then rename the new file (called python - Copy.exe) to python3.exe.

view this post on Zulip Floris van Doorn (Nov 25 2019 at 22:17):

I really should turn this step into a command-line instruction...

view this post on Zulip Ashvni Narayanan (Nov 25 2019 at 22:20):

pasted image

I seem to have a lot of files with that name..

view this post on Zulip Floris van Doorn (Nov 25 2019 at 22:22):

It is the one near the bottom, in the folder ...\Programs\Python\...

view this post on Zulip Floris van Doorn (Nov 25 2019 at 22:24):

The folder should be something like C:\Users\<user>\AppData\Local\Programs\Python\Python37-32

view this post on Zulip Floris van Doorn (Nov 25 2019 at 22:25):

You can also see the right directory by typing which python or where python in git bash: that is the python you want to copy.

view this post on Zulip Ashvni Narayanan (Nov 25 2019 at 22:27):

It seems to be working fine now. Thank you very much!


Last updated: May 15 2021 at 22:14 UTC