Python environment installation

  • 2020-04-02 13:58:40
  • OfStack

Any high-level language needs to have its own programming environment, which is just like writing. It needs to have a pen and paper to write things on the computer, and it also needs to have word processing software, such as various names of OFFICE. Pen and paper and office software, which is the hardware or software for writing things, in short, those words can only be written on top of that to become an article. So programming is also, you have to have a program or something, you have to write the program on top of that, in order to end up with something like an article.

There's another term -- "program." what is a program? I won't talk about it in this article. If you don't understand the term, Google it online.

Note: a very important learning method is recommended

Those of you who read this article here, and even those of you who are not, don't expect to learn a lot of advanced python language skills here.

"Damn, is that nonsense?"

No. The important thing is to learn some methods. For example, just give you the recommendation of "Google the Internet", is a very good way to learn. Of course, in a country for a long time the Internet is equal to the entertainment network, I loyal hope from the friends who read this article, the Internet is not only entertainment network, or the knowledge network and the creation network. I'm going to pull it back. In the process of learning, if you encounter a little doubt, don't let go, think about it, try it, whether there is no result, also want to Google.

The list is good, what I write above is very clear, it is Google once, not ask everybody to use that what degree to search, that search is special search gossip, fake medicine, and all sorts of dress very thrifty girl's photograph. If you really want to improve your technology vision and focus on technical issues, use Google. Of course, I know you are difficult to use when, as a person who wants to have some technical achievements, must learn some Internet technology, you know.

What? You don't understand? You are indeed my reader: zero base. Then ask me specifically, whether it is to join the QQ group or micro blog, can be.
To practice magic skill, swing a knife from the palace. Divine power is conditional.

To learn python, you don't have to learn it yourself. Python doesn't have to be such a brutal premise, but you also need to install something to use it.

What you need to install, in this page are: (link: http://www.python.org/downloads/)

This is the official python website, and if you know enough English, you can get a lot out of reading it yourself.
In the python download page, it shows that there are currently two major categories of python, one is python3.x.x, and the other is python2.7.x. Python3 is the future, so to speak, and it's an improvement over python2.7. But, right now, there are a lot of things that are not fully compatible with python3. What's more, if you learn python2.7, for python3, it's just a small change in some place.

So, I'm using python2.7 as an example.

Installation of Linux system

What is the operating system of the computer? Figure it out for yourself. If it's a Linux distribution, follow my lead. And I congratulate you, because there will be more python libraries (modules) installed in the future. Under this operating system, the operation is very simple, of course, if it is iOS, the same is true, because they are all UNIX eggs. But the widows is a bit different.

But, no matter, python is cross-platform.

I'll take ubutu 12.04 as an example. For those of you who use this operating system (which is pretty rare), you're going to type python into your shell if you see it > > > , and displays the python version information, congratulations, because your system already has python's environment. Indeed, ubuntu has a built-in python environment.

I must install it myself. Here's how to do it:


# Download the source code, the latest version is 2.7.8 If you change later, you can change the version number in the following command 
# The source code can also be downloaded from the website, see the above download page 
wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz

# Unzip the source package 
tar -zxvf Python-2.7.8.tgz

# compile 
cd Python-2.7.8
./configure --prefix=/usr/local  # Specified directory 
make&&make install

The above steps, I found from the Internet, for reference. Because my machine already installed, do not want to toss about. Once installed, enter the shell, type python, and you'll see the following:


qw@qw-Latitude-E4300:~$ python
Python 2.7.6 (default, Nov 13 2013, 19:24:16) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Congratulations, the installation was successful. I'm using python2.7.6. Maybe you have a higher version.

Installation of Windows system

Go to the download page to find the Windows installation package, download it, such as downloaded the file: python-2.7.8.msi. Then it's a continuous "next step" to complete the installation.

In particular, after you've installed it, you need to check to see if you have python in your environment variables.

If you don't know what Windows environment variables are and how to set them. Don't worry, Google it. Search for "Windows environment variables" to find out how to set them.
That's it. In CMD, type python and get a similar result.

Installation of Mac OS X system

In fact, there is no need to write how to install, because the friends who use Mac OS X, must be the high master of the masters, at least I have always been very admire those who use Mac OS X and insist on not changing to Windows. For those of you who use Mac OS X, search the web yourself.

If you follow the above method, successful installation, can only be said to be lucky, without it. If the installation is not successful, this is a good opportunity to improve themselves, because only encounter problems to solve the problem, to know more profound truth, don't be afraid, there is Google, it can help to list all the problems. Of course, join QQ group or ask me via weibo.

OK! Once you've installed it, you're ready to start programming. "We programmers, we don't want to pass, but we want to report an error."


Related articles: