程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Mac settings reset the python3 environment

編輯:Python

Python3 Environment reset installation

I don't know what has been deleted, which makes the code unable to work properly ; It seems that the environment is broken Baidu is useless ; So I decided to reinstall python Environmental Science , By the way, record the steps .( Before, there were many environments , It may be caused by deletion )

uninstall python3.x Environmental Directory

lookup python3 The catalog of , Generally, the default directory is /Library/Frameworks/Python.framework/Versions/3.7

1.sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.7 Delete the frame directly
2. Get into cd /Applications Catalog , sudo rm -rf Python 3.7 Delete Python 3.7 Application directory
3. Get into /usr/local/bin Catalog , see ls -l /usr/local/bin Lower soft connection ,rm Python3.7 Delete related files and links

4. Delete manually python3.x Profile information
open ~/.bash_profile Open profile
source ~/.bash_profile Immediate effect

Finally, verify whether the deletion is clean , Input

python3
which python3
python3 --version
pip -V

reinstall python3.6 Environmental Science

download python Installation package

Download from the official website : Jump to the official website
Tips : If the official website is slow to download, you can use the online disk to download
Online disk download ::python3.7/3.8

To configure python The configuration file

open ~/.bash_profile Open profile

# To configure python3 and pip3 Information 
alias python3="/usr/local/bin/python3.7"
alias pip3="/usr/local/bin/pip3"
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
alias python3="/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7"
alias pip3="/Library/Frameworks/Python.framework/Versions/3.7/bin/pip3"

source ~/.bash_profile Immediate effect
Test the console :

To configure python Soft connection

see python edition
python --version
python3 --version
View this machine python The installation directory
which python
which python3

sudo ln -s sudo ln -s /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 /usr/local/bin/python
# -s Fill in the following python3.7 Installation path for Followed by the soft connection address 

Verify after configuration Input python and pip list

To configure allure Report information

allure After decompression, you need to configure environment variables , Otherwise it can't start

export PATH=${
PATH}:/Users/songpeilun/allure-2.13.0/bin

To configure Jmeter Information

export JMETER_HOME=/Users/songpeilun/apache-jmeter-5.0/bin

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved