Can I ask some basic Python installation questions?

  • Python
  • Thread starter RPinPA
  • Start date
  • #1
RPinPA
Science Advisor
Homework Helper
571
319

Main Question or Discussion Point

I finally decided to do something I've been meaning to do for a couple years, namely learn Python. I opted for a Coursera course sponsored by IBM. They provide a "lab" that has everything you need to write and test code fragments in Python 3.

But now I'm at the point of wanting my own environment in my OS/X computer(s). My understanding is that OS/X distributes with Python 2, so if you want Python 3 you need some extra software. After skimming a couple recommended articles including at python.org, I've so far done the following:

- installed the Python 3.8.1 package from the Python website. This creates a Python 3.8 folder in your Applications folder that includes a development environment called IDLE and an application called Python Launcher which is the recommended way to run your *.py scripts.
- I also downloaded BBEdit because that seems to be highly recommended as a text editor / dev environment.

Now I'm stuck about how to wire various things up to have a nice smooth Python 3 experience so I have some rather basic questions. I have no IT person to go to since leaving my day job, so I'm hoping folks here are willing to help. Also I'll take unsolicited advice on editors and development environments, for this and other languages.

I used to be reasonably familiar with Unix (Linux) and emacs and wonder if going that route via the terminal would be useful, but I've forgotten a lot and not sure how to get back up to speed.
 

Answers and Replies

  • #2
11,794
5,402
Have you looked at the Anaconda distro for python? After installation, things will be wired up correctly. Special modules can be downloaded and installed via the conda command.

You can also create different environments for specific projects.

https://www.anaconda.com/distribution/
 
Last edited:
  • Like
Likes cobalt124
  • #3
RPinPA
Science Advisor
Homework Helper
571
319
Have you looked at the Anaconda distro for python? After installation, things will be wired up correctly. Special modules can be downloaded and installed via the conda command.

You can also create different environments for specific projects.

https://www.anaconda.com/distribution/
First time I heard of it. Looks interesting. Includes several packages I'm interested in and others that I haven't heard of that will probably be useful.

In particular I wanted to start with numpy, which didn't come with the python.org distribution. So my first questions have to do with adding packages to that distribution. You can find lots of websites telling you the command-line commands to manage packages, but the command line in terminal defaults to Python 2. I remember there's a special file that does setup for new command shells but don't recall where it is (you can see how much basic stuff has escaped me from not using it for a couple of years). Also, I believe the shell running by default in terminal is bash, which I'm not that familiar with.

I guess if I wanted to use terminal commands the easiest thing would be to create a script that puts Python 3 in the path ahead of Python 2, and call that only when I need it. Once I figure out the bash syntax to do that. Or should I skip the terminal and figure out how to do this stuff with IDLE or some other environment?

This whole process is starting to make me feel like one of those old guys who complains he needs to borrow grandchildren to program his devices. I'm not there yet but the basic-ness of my questions is embarrassing.
 
  • #4
PeterDonis
Mentor
Insights Author
2019 Award
29,591
8,883
In particular I wanted to start with numpy, which didn't come with the python.org distribution.
This is one of the use cases that anaconda was specifically designed for, so I think you'll find that it will make things much easier for you than trying to wrestle with OS X's default configuration for the terminal and other such.

You can find lots of websites telling you the command-line commands to manage packages, but the command line in terminal defaults to Python 2.
Not only that, but AFAIK OS X doesn't play nearly as nicely with things like pip install (or pip3 install if you want to force Python 3 and if it's available in the terminal--OS X doesn't always put things where a typical Unix would) as Linux or even Windows does. It's been some time since I dealt with this in any detail on OS X, but when I did I had the persistent feeling that I was trying to color outside the lines and Apple didn't like me to do that. I don't get that feeling at all when I do similar things on Linux.
 
  • Like
Likes jedishrfu
  • #5
Dr Transport
Science Advisor
Gold Member
2,371
497
I installed Anaconda on my windows box, it worked seamless from the beginning. numpy is installed.
 
  • Like
Likes jedishrfu
  • #6
11,794
5,402
There’s also the Jupyter notebooks that people really like and anaconda has that covered too. Basically a web page for program snippets, commentary and output rolled into one. Great for giving lectures and doing research.

https://jupyter.org/install
 
  • Like
Likes Borg
  • #7
RPinPA
Science Advisor
Homework Helper
571
319
OK, so it sounds like Anaconda has a lot of popular packages right out of the box. Does it also make it easy to add additional packages?

Also, what do people like for 2D and 3D graphics? Matlab is still my favorite for both. It never looks that great with the default settings but if you tweak enough attributes you can get some pretty darn nice looking graphics in Matlab. Is there anything comparable in Python?
 
  • #8
Borg
Science Advisor
Gold Member
1,874
2,310
There’s also the Jupyter notebooks that people really like and anaconda has that covered too. Basically a web page for program snippets, commentary and output rolled into one. Great for giving lectures and doing research.

https://jupyter.org/install
+1 on that. I work almost exclusively with Jupyter notebooks when I'm coding in python. It is an awesome tool with lots of great features.
 
Last edited:
  • #9
cobalt124
Gold Member
43
29
Yes, definitely use Anaconda, I asked the same question fairly recently and had Python up and running more or less straightaway. Pip install works fine for installing extra packages.
 

Related Threads on Can I ask some basic Python installation questions?

  • Last Post
Replies
10
Views
996
Replies
1
Views
366
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
5
Views
6K
Replies
6
Views
842
Replies
3
Views
972
Replies
7
Views
1K
  • Last Post
Replies
3
Views
2K
Replies
2
Views
2K
Replies
17
Views
5K
Top