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

Python2 and python3 installations coexist

編輯:Python

Because I accidentally installed one python2 Of 64 Bit and python3 Of 32 position , As a result, some programs cannot run , But I can only uninstall python3 Of 32 position , Then delete the folder , download python3 Of 64 position , reinstall , Then I met python2 and python3 The problem of coexistence , Comb it over again .

1、 download

I suggest you download one 64 Bit , although 32 Bit wider , But many high performance requirements 64 position

Download and install

Recommended installation C:\

2、 If the installation process is checked add path to Variable , Then don't move , without , You need to add Path

3、 modify python Edit the name

python2 Inside python.exe Change to python2.exe pythonw.exe Change to pythonw2.exe

python3 Inside python.exe Change to python3.exe pythonw.exe Change to pythonw3.exe

Depending on personal preference , Main use 2 You can omit numbers 2, Main use 3 You can omit numbers 3

4、 Set up pip

python2 -m pip install --upgrade pip

python3 -m pip install --upgrade pip

pip2 -V perhaps pip3 -V You can view the version

5、 Environmental restoration

Before that    pip freeze >requirements.txt export

then  

pip3 install -r requirements.txt that will do

pip install [package-name] # The installation name is [package-name] My bag
pip install [package-name]==X.X # The installation name is [package-name] And specify the version X.X
pip install [package-name] --proxy= proxy server IP: Port number # Use a proxy server to install
pip install [package-name] --upgrade # The update name is [package-name] My bag
pip uninstall [package-name] # Delete the name [package-name] My bag
pip list # List all installed packages in the current environment 

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