The first day of the first week 01

Note: This day is wasted, don’t read it, I uninstalled all the following installations, please refer to the blog "The first day of the first week 02 + the second day of the first week 01"

 

 

Zero, environment construction requirements:

In the win7 operating system, install python 3.5 , install spyder , and download tensorflow , keras and other related libraries

 

 

1. Installation of the development environment Anaconda3-4.1.1 version

Reference tutorial:

https://blog.csdn.net/wz947324/article/details/80205181

https://blog.csdn.net/ITLearnHall/article/details/81708148

https://www.jianshu.com/p/d3a5ec1d9a08

https://www.jianshu.com/p/169403f7e40c

1. The concept and function of Anaconda?

Simply put, Anaconda is Python's package manager and environment manager. Let's first solve a question that beginners will ask: I have installed Python, so why do I need Anaconda? The reasons are as follows:

(1) Anaconda comes with a large number of commonly used data science packages, which comes with conda, Python, and more than 150 scientific packages and their dependencies. So you can start processing data immediately with Anaconda.

(2) Management package. Anaconda was developed on conda (a package manager and environment manager). In data analysis, you will use many third-party packages, and conda (package manager) can help you install and manage these packages on your computer, including installing, uninstalling and updating packages.

(3) Management environment. Why do we need to manage the environment? For example, you use Python2 in the A project, and the new project requires Python3, and installing two Python versions at the same time may cause a lot of confusion and errors. At this time conda can help you build different operating environments for different projects. There are still many projects that use different package versions, such as different pandas versions, it is impossible to install two pandas versions at the same time. What you need to do is to create the corresponding pandas version in the corresponding environment of the project. At this time conda can do it for you.

Summary: Anaconda solves two major pain points of official Python:

(1) The package management function is provided, and the scene where the installation of third-party packages on the Windows platform often fails is solved.

(2) Provide environment management function, solve the problem of coexistence and switching of multiple versions of Python.
 

1.1 What is Anaconda?

Anaconda is a Python release that focuses on data analysis, including more than 190 scientific packages and their dependencies, such as conda and Python. As a curious baby, did you discover a new term conda , then you must ask what conda is?

1.2 What is conda?

Conda is a management system for open source packages and virtual environments.

  • Package management: You can use conda to install, update, and uninstall toolkits, and it focuses more on data science-related toolkits. When anaconda is installed, it is pre-integrated with packages commonly used in data analysis such as Numpy, Scipy, pandas, and Scikit-learn. It is also worth mentioning that conda not only manages Python toolkits, it can also install non-python packages. For example, in the new version of Anaconda, you can install the R-language integrated development environment Rstudio.

  • Virtual environment management: Multiple virtual environments can be established in conda to isolate different versions of toolkits required by different projects to prevent version conflicts. For students who are struggling with the Python version, we can also set up two environments, Python2 and Python3, to run different versions of Python code.

Know what is (what) at the same time, we also need to ask why the (Why) . So, why choose Anaconda?

1.3 The advantages of Anaconda?

The advantages of Anaconda can be summed up in eight words: time-saving and worry-free, analytical tool.

  • Save time and worry: Anaconda greatly simplifies your workflow by managing toolkits, development environments, and Python versions. Not only can the toolkit be easily installed, updated, and uninstalled, but the corresponding dependent packages can be automatically installed during installation, and different virtual environments can be used to isolate projects with different requirements.

  • Analysis tool: This is how I promote myself in the Anaconda official website: Python tools for enterprise-level big data analysis. It contains more than 720 open source packages related to data science, which are involved in data visualization, machine learning, deep learning and many other aspects. It can be used not only for data analysis, but also for big data and artificial intelligence.

 

 

2. The installation process of Anaconda3-4.1.1 version

(1) Anaconda installation version

I first look at the python version Python 3.7.3 I installed before. According to the table, I went to download and found that I should download the 2019 version, but I saw the training platform file wrote that for better compatibility, it is recommended to use a slightly older version , And then I searched and found that multiple python versions under the windows system are compatible, so I plan to download the recommended anaconda3-4.1.1 version on the training platform.

 

 

(2) Download the installation package

It is recommended not to download from the official website. The latest version of anconda under windows is more than 500M. The official website download is slow and takes a long time. It is recommended to go to the open source mirror station of Tsinghua University to download. surroundings.

Download link: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

 

 

Then because my C drive is relatively small, I plan to install it on the E drive.

 

 

 

(3) Start the installation

I installed it on the E drive, which has a lot of space.

The first check is whether to add Anaconda to the environment variables. The official prompts do not recommend checking. It is said that after checking, it may cause problems when uninstalling or reinstalling in the future. If checked, you can directly use conda and jupyter in cmd. Commands such as, ipython, etc., if you don’t check it, you can also use the command line tool provided by Anaconda later. This is actually not a big problem if you check it or not. I chose the official recommendation and did not check it.

The second tick is whether to set Python 3.5 that Anaconda brings as the default Python version of the system.

Wait for installation (remember to configure environment variables after installation is complete)

The installation is complete.

 

(4) Set environment variables

There are two main environment configurations:
①Anaconda installation path (for Python to check normal): The path must be clearly remembered during the previous installation

My default is E:\Softwares\anaconda3\Anaconda3-4.1.1
②Installation path\scripts (for conda check to be normal): Just find scripts in the above path and copy the path. My default path is E: \Softwares\anaconda3\Anaconda3-4.1.1\Scripts

The above two environment variables are passed: this computer-right click-advanced system settings-environment variables-system variables-double-click path-create these two variables.

 

 

(5) Inspection

Shortcut key: Windows+R
or Windows system—Run—cmd—
①After
entering Python, the following display can prove that there is no problem

②Conda
input conda and the following display can prove that there is no problem


③Update the upgrade kit (to avoid possible errors) After conda upgrade --all
, you can enter y when prompted

(10.25 Supplement: This step seems to be performed in the Anaconda Prompt window)

 

3. Manage virtual environments

Next we can use anaconda to create our independent python environments. The following examples are all operated on the command line, please open your command line.

Anaconda Navigator is the visual management interface of Anaconda.

Anaconda Prompt is an Anaconda terminal, which can conveniently operate conda environment, similar to cmd command line tool

Jupyter Notebook is an interactive notebook that supports running more than 40 programming languages.

IPython notebook is a web application based on IPython REPL. After installing IPython, enter ipython notebook in the terminal to start the service.

Jupyter is the product of separating IPython and Python interpreter, and will gradually replace IPython and be released independently.

Spyder is an open source cross-platform scientific computing IDE using Python language. Spyder can be cross-platform, can also be expanded with additional components, with interactive tools to process data.

Second, use Anaconda to create a simple Python

Refer to Baidu:

https://jingyan.baidu.com/album/2c8c281d6b0d6d0008252a06.html?picindex=1

1. Find Spyder from the start menu and open it

2. Click view----Panes----project explorer in the menu bar in turn

3. Click File----NewProject in the menu bar in turn

Just YES!

Enter Project name

4. Right-click the project name HelloWorld on the Project explorer, click "New"->"File", and add a helloworld.py file

(The following picture on Baidu)

5. In the opened helloworld.py, enter a simple python statement, then select it, click the green triangle symbol in the toolbar to run the program

(------end------)

Three, tensorflow configuration

When I started to prepare the configuration, I found such a blog post

https://blog.csdn.net/XunCiy/article/details/89016510

I want to experiment with this.

Guess you like

Origin blog.csdn.net/sunshine04/article/details/106616394
Recommended