官术网_书友最值得收藏!

Installing Python

The Linux Ubuntu system will come with a version of Python. I am going to assume that you are familiar with Python, as we will be using it throughout the book. If you need help with Python, Packt Publishing has several fine books on the subject. 

Once you log on to your Virtual Machine, check which version of Python you have by opening up a terminal window and typing python at the command prompt. You should see the Python version as follows:

Python 2.7.12 (default, Dec  4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

You can see that I have version 2.7.12.

We are going to need several add-on libraries that augment Python and extend its capability. The first thing to check is to see whether you have pip installed. Pip is a Python Installation Package that helps to load other packages from the internet to extend Python. Check to see whether you have pip by typing the following:

pip

If you get No command 'pip' found, then you need to install pip. Enter the following:

Sudo apt-get install python-pip python-dev build-essential
Sudo pip install –upgrade pip

Now we can install the rest of the packages that we need. To begin with, we need the python math packages numpy, the scientific python libraries scipy, and the math plotting libraries matplotlib. I will direct you to install other packages as required in the relevant chapters.

Let’s install our other libraries. We need the numerical python library (numpy), the scientific python library (scipy), and matplotlib for making graphs:

>>sudo apt-get install python-numpy python-scipy python-matplotlib python-sympy

If you want to use the iPython (interactive Python) and Jupyter Notebook process to test your code (and document it at the same time), you can install those as well. I will not be using them in this book, but I do admit that they are quite useful.

>>sudo apt-get install ipython ipython-notebook

I'll cover the other Python libraries that we will use later (Open CV, Scikit-Learn, Keras, and so on) as we need them in the appropriate chapters.

主站蜘蛛池模板: 滁州市| 徐汇区| 台南县| 盘锦市| 临泽县| 酒泉市| 金山区| 兴安县| 桃源县| 巫溪县| 灌阳县| 朝阳区| 江阴市| 高阳县| 峨眉山市| 大余县| 佛冈县| 高邑县| 缙云县| 祥云县| 福州市| 玉林市| 定安县| 沙湾县| 满城县| 阿鲁科尔沁旗| 新龙县| 舟曲县| 古交市| 宿迁市| 虞城县| 正镶白旗| 仁寿县| 华宁县| 呼玛县| 泰来县| 民乐县| 昌宁县| 寿宁县| 泰宁县| 呼和浩特市|