I wanted to learn Python, I installed some software. I created a little execution files and none of them will execute. So I've checked my terminal and type basic things like Is
, cd
etc. None of them work
:Users me$ cd
:~ me$ cd
:~ me$ cd /
:/ me$ Is
-bash: Is: command not found
:/ me$ cd ~
:~ me$ cd desktop
:desktop me$
If I type echo $PATH
, here the result:
/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I read many things about how to fix it but I don't understand. For example:
- I don't know how to find the User Folder
- I don't know how to get to the bash.profile
Bear in mind that I am very new to this.
Best Answer
If you want to list all files/folders in a directory, you should type
ls
notIs
. It is L, not i.To learn python, you won't need to reach
~/.bash_profile
unless you need to change versions. Just usewhich python
orpython --version
and use the syntax for the version that appears. Or use online compilers for quick testing.Suppose you have your file
learn.py
at Desktop, you typecd ~/Desktop
, typels
to confirm, and then to run the file as a script, typepython learn.py
. To enter python console, typepython
and use it.Wherever your file is, you could type
cd
in Terminal, then drag your file into Terminal window and press Enter. Terminal will resolve the path for you.For further help, refer to Stack Overflow. :)
If you want to see bash profile, open Finder, type command + shift + . to reveal hidden files and then command + shift + G and type
~/.bash_profile
in "Go To". But don't edit it unless required.