Learn python and tensorflow under mac, solve environmental problems with one click through anaconda

The first problem facing learning tensorflow is that the environment is configured, various python versions, tensorflow versions and various application packages

Now solve all problems with one software: anaconda

It can do it: a brand new computer, nothing is installed, just install the anaconda  software and you can start development

  1. download

https://www.anaconda.com/products/individual#download-section

After installation, open the terminal command tool that comes with the mac, enter jupyter notebook and wait a while

If you need to change the default storage path of files, you can close jupyter and enter in the terminal

jupyter notebook --generate-config

The system will automatically generate a file and return the file name and address

Writing default config to: /Users/jiangshanruciduojiao/.jupyter/jupyter_notebook_config.py

Then copy the above path, and then edit the file

vim /Users/jiangshanruciduojiao/.jupyter/jupyter_notebook_config.py

 Then enter the diagonal bar to search notebook_dir

/notebook_dir

Remove the hash mark in front and add the full path of the directory you want to store in the back

Then press esc, then enter colon ➕ wq to save

Then start again 

If it is windows, remember to remove the path behind the jupyter startup shortcut

 

Anaconda comes with many commonly used python libraries by default, such as numpy, scipy, etc.

But it does not come with tensorflow, so you need to install it yourself

How to install it?

Open the anaconda software, open the command line as shown in the figure below, execute the following installation commands, the Ali source speed is still relatively fast

pip install tensorflow-cpu==2.2.0 -i https://mirrors.aliyun.com/pypi/simple/

Successfully installed appears to indicate successful installation

 

If you want to install other libraries, you can use a similar method, don’t fill in if you don’t know the version number, and download the latest version by default

pip install xxxxxxx -i https://mirrors.aliyun.com/pypi/simple/

 

Guess you like

Origin blog.csdn.net/l1509214729/article/details/109131129