At the beginning
I just got a macbook Pro recently, but I didn’t plan to use it as a development machine at first, but I still wanted to write some code occasionally. So I spent two days to fill in various holes, and finally configured the common environment. Here is how to install each software separately.
First of all, my computer configuration is 16GB +2TAs soon as I got it, there was a system update, and then the installation started.
Software Installation
1.QQ/ wechat/Baidu Cloud etc
This kind of software can be found in the App Store and installed directly, if not, go to the official website to install, the worst is to translate and use, the problem is not particularly big.
2. JetBrains series
Currently, these models have been installed, and all licenses have been successful (the reason for violation cannot be written).
3.nvm/node
Because I am learning vUE related knowledge recently, some front-end software is also essential. To install Node, I recommend using BREW to install NVM, and then NVM installs Node. NVM management of nodes is convenient, but currently only Node V15 is compatible with M1, so this management issue is not necessary. Now let’s look at the steps
1. Install homebrew
Check out this blog post and follow the steps above. Be sure to configure PATH or you won’t find brew
2. Install NVM and Node using BREW
referenceblogJust install NVM and use NVM to install Nodenvm install v15
If the terminal cannot find the NVM, press the figure abovebrew info nvm
, and follow the instructions to configure the path.
Show results:Then CNPM, VUE, VUE-CLI… Just install it as you did before
4.conda+tf+pytorch+opencv
Currently there is no M1 adapter for Anaconda, only miniForge
miniforge Select miniforge3-macosx-arm64, where the arm64 version of miniforge is based on python3.9. Create a python3.8 virtual environment for subsequent installation of tensorflow and other support, as shown in the following figureThe first sentence is changed toConda create -n python38 python=3.8
Because I named it that way, and you’ll do the same if you follow it, you don’t have to change too much.
The following installation operations are then performed in python38conda activate python38
which pip
Be sure to use python3.8
1.tensorflow
Currently, tensorlFOW for M1 is version 2.4. First of all, you have to download Alpha3 version of TensorFlow for detailed operation steps to check this articleblogRemember to download theSo please pay attention to the filename of the file corresponding to Tensorflow in the above blog, otherwise it will fail.
After the installation is complete, you will see successful. However, running Python to import TensorFlow may cause KILLED Python
Solution: AT first, I thought it was the version problem, but I tried all three versions but it didn’t work, search found the SIP problem of MAC. To turn off the SIP method, power it off and hold down the power button (the one used for fingerprint identification) until an option appears. Click continue to open terminal, type CSrutil Disable, then y, confirm. Wait for the command line to finish and restart. Run the virtual environment again and try TensorFlow successfully.
2.pytorch
Download WHL https://ossci-macos-build.s3.amazonaws.com/torch-1.8.0a0-cp38-cp38-macosx_11_0_arm64.whl with conda installation numpy or before installation conda install pytorch torchvision -c pytorch ‘-c=conda-forge’
3.opencv
Opencv installation follows the above steps step by step, just change cmake to its own path.
Other Python libraries can be installed directly by Conda, with the same operations as before.
Display the results
5.Go
Go has officially released beta version 1.16 and can now be downloaded directly from the official websiteDownload it, unpack it, and install it directly.
6.vscode
Go to the official website and download the corresponding version. After decompressing should be an app, use it directly.
7. Other
There are also some mysql and other tools nothing special is not noticed, later encountered to update.
The last
After a few days of use and source code compilation, feel M1 use or more comfortable. However, there are still some software not suitable for M1, such as wechat… In addition, I haven’t tested video clips and render exports yet, so I won’t comment on them here. As for the battery life part, it’s really impressive, even with PyCharm, IDEA and a bunch of apps on.
My personal advice is to buy an Air experience if you really want to experience M1. If you use it for development, you may encounter some strange problems, and they may not be very easy to solve on your own. If you have enough money now, but are not in a hurry to replace your PC, you can wait until the second half of the year when the M1x(M2) is released. It looks like there will be a 16-inch version, and software adaptation will be more popular then.
2021/4/2 update
Selenium + browser driver configuration
Selenium is still a good install for PIPConfiguration of the articleCheck the browser version, download the corresponding version of the driver (click the link in the article to download it), and put it in the project (package it to someone else without extra configuration), and note the path in the code. However, you need to change the source code in Selenium in Mac by removing.exe from the source code.Pycharm ==command+ click ==