I have tried a lot of things without success but maybe there is still hope for me to start learning Python (3.7) on my machine ). Therefore my question: How can I make Atom and apm prioritize/recognize Python 3.7? My conclusion is that Atom and the Atom Package Manager seem to prioritize Python 2.7.10 over Python 3.7.0 (or maybe not even recognize Python 3.7?). Notice here, again, that the Atom Package Manager ( apm) displays Python 2.7.10 and NOT Python 3.7.0. Testing Atom further, I noticed that the only two packages (linter-flake8 and python-autopep8) where I had to manually install packages through pip in my terminal seem not to be working.įurthermore, typing apm -version in my terminal outputs: apm 1.19.0 Import sys // print("Version ",sys.version) in Atom through script to test which version of Python it uses, it outputs Python 2.7.10 and NOT Python 3.7.0 (the version I want). I know that macOS High Sierra is shipped with a pre installed version of Python (2.7.10). To setup Python correctly, I have also installed the Xcode commands, homebrew, virtualenv, pip and git as well as some useful packages in Atom such as linter-flake8, python-autopep8, script, etc. That will help you get this figured out, and you’ll see how this works after you do Appendix A.I have just installed Python 3.7 together with Atom on my Mac running High Sierra because I want to start learning the language. When you go through appendix A I want you to religiously type these two commands religiously like your life depends on it: Looking at your path in your Atom, you are saving the files into Desktop/exercise files, but then you don’t cd into that directory to run your code.My computer prints that out so I know where I am at. You are seeing the /Users/zed part of the screen in my screenshots or videos, but that is not typed by me.I believe two misunderstandings are happening here: Did you go through Appendix A to get familiar with the command line?.Slow it down and pause to watch me do it. Did you watch the video? I do this on OSX so you can see what I type. Now, this makes me think a couple things: You’re typing a whole path in front of what you type, but I just type that command. If I read that it’s “python three seven ex1.py”. Now, look at how I run it: python3.7 ex1.py If I read that it’s “Users chef python three point seven exercise one py”. So you typed this: /Users/chef python3.7 exercise1.py But having to use terminal to tell the computer to ‘send’ and await the response to save “message sent” or “message failed: unknown recipient”. Imagine writing an email in your email client and saving it. The alternative is writing it all in the terminal which is prone to error as you kind of have one take to get it right.īasically, they are different things. Running the saved files like this is useful as you get a lot of useful info from terminal when things go wrong. This is done by telling the computer to run python and pass it the file you saved: python ex1.py (In fact you can also do it from Atom/VS too). The key is that you can use the terminal to run the file you just saved. No different from writing a word document or email really. All you do is write text, but in a coding style and save it. It runs the program in a special embedded way that executed python like in the book.Ītom, Visual Code and other Editors are really just like MS Word, TextEdit or other document tools, but designed specifically for working with code. You can run Python from the terminal by typing ‘Python’. It’s very power and a little intimidating. In the old days you didn’t have windows you could click and drag about, double-clicking on things and using menus to copy or save. The terminal is like a little doorway into controlling your computer, but not with the user interface (UI) that Bill Gates and Windows made really popular. You have a bit of misunderstanding here I am afraid.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |