Mac installation python environment & pycharm

1. Document description

In fact, the Mac has its own python environment, but many libraries install python with version 2.7.

Verification: You can enter in the terminal Terminal: python

The picture below is before installation, but we need to install the python 3.0 version on our Mac.

Two, python environment installation

1. Download the application on the python official website: https://www.python.org (sometimes the network is slow)

2. After the download is complete, you can get a pkg file

3. Double-click directly to enter the installation page, click [Continue] until the installation prompt appears

4. In the installation prompt, directly click [Agree] - [Install] (if the current system has set a password, you will be prompted to enter the password during installation, you enter the password, and click [Install Now] to finish.)

5. After the installation is complete, the following interface will be displayed, and the installation will be successful.

6. At this time, we open the terminal (Terminal) and enter: python3, and the following interface will be prompted:

7. [Important] Then why can't we directly enter python to display our version 3.0?

Reason: Because the environment variables of the python 2.0 version are earlier than python 3.0, the corresponding settings must be made

Step 1 : Get the installation path of python3, open the terminal (Terminal) and enter: which python3

Step 2 : Open the .bash_profile file (the file may or may not exist, if the first command does not work, choose the second one)

First one: open -e .bash_profile (file exists)

The second: vi ~/.bash_profile (the file does not exist)

Step 3 : [Important] Enter the following code and command+s to save, be sure! ! !

Step 4 : Open the terminal (Terminal) and enter: source ~/.bash_profile, and then enter: pyhton

步骤5:做到以上操作你每关闭终端一次,再次打开都需要重新source ~/.bash_profile一下,所以还需要做以下步骤,请一定耐心,马上成功。

在终端输入: 第一步:vi ~/.zshrc 第二步:按i 进行输入,添加:source ~/.bash_profile 第三步: 按esc输入: :wq进行保存退出

三、安装pycharm

1. 进入到官网:https://www.jetbrains.com/pycharm/download/#section=mac

2. 得到一个dmg安装包,双击打开,并拖动到Applications

3. 等待安装后直接打开并新建文件即可,如下即表示安装完成。

最后感谢每一个认真阅读我文章的人,礼尚往来总是要有的,虽然不是什么很值钱的东西,如果你用得到的话可以直接拿走:

这些资料,对于【软件测试】的朋友来说应该是最全面最完整的备战仓库,这个仓库也陪伴上万个测试工程师们走过最艰难的路程,希望也能帮助到你!有需要的小伙伴可以点击下方小卡片领取

Guess you like

Origin blog.csdn.net/hlsxjh/article/details/129411697