Zulip Chat Archive

Stream: general

Topic: Installing python(mathlib)


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?

Floris van Doorn (Nov 25 2019 at 21:45):

What directory is your copy of python3.exe located?

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.

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.

Floris van Doorn (Nov 25 2019 at 21:48):

What is the output of which python3?

Ashvni Narayanan (Nov 25 2019 at 21:49):

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

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

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?

Ashvni Narayanan (Nov 25 2019 at 21:57):

You mean reinstall the entire thing?

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.

Ashvni Narayanan (Nov 25 2019 at 22:01):

It says No such file or directory

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.

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.

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)

Ashvni Narayanan (Nov 25 2019 at 22:07):

Now it just says command not found

Ashvni Narayanan (Nov 25 2019 at 22:07):

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

Floris van Doorn (Nov 25 2019 at 22:07):

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

Ashvni Narayanan (Nov 25 2019 at 22:08):

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

No, it gives
Python 3.8.0

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.

Floris van Doorn (Nov 25 2019 at 22:12):

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

Ashvni Narayanan (Nov 25 2019 at 22:13):

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

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.

Floris van Doorn (Nov 25 2019 at 22:17):

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

Ashvni Narayanan (Nov 25 2019 at 22:20):

pasted image

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

Floris van Doorn (Nov 25 2019 at 22:22):

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

Floris van Doorn (Nov 25 2019 at 22:24):

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

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.

Ashvni Narayanan (Nov 25 2019 at 22:27):

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


Last updated: Dec 20 2023 at 11:08 UTC