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

Installation of Python environment

編輯:Python

1. download Python

  • visit Python Official website : https://www.python.org/

  • Click on downloads Button , Select the system type from the drop-down box (windows/Mac OS/Linux etc. )

  • Choose to download the latest version of Python

If there is no version requirement , Try to use the latest version and previous versions . Avoid the instability of the new version

2. install Python

  • Double click download okay Python Installation package

  • Check the bottom left corner Add Python 3.7 to PATH Options , And then choose Install now Install now Python.

  • Default installation

  • Custom installation

3. Test for successful installation

  • win key + r, Input cmd enter Enter into windows Command line mode for .

  • Enter... On the command line Python, Correct display Python edition , It indicates that the Python Installation successful

  • If you type... On the command line python Tips Not an internal or external command

Maybe it's because you're installing Python There is no check in the process of Add Python 3.7 to PATH Options , At this point, you need to manually adjust Python To configure .

4. Manual configuration Python environment variable

Be careful : If during the installation process , It's already checked Add Python 3.7 to PATH Options , And in cmd Enter... In command mode python Instructions Don't complain , There is no need to manually configure Python.


Right click This computer --> choice attribute

find Python Installation directory , Add the path in .

5. pip Use

pip It's a modern , General purpose Python Package management tools . Provide for the right to Python Bag search 、 download 、 install 、 Uninstalled features , then For us Python Management of resource packages .

install :

install Python when , Will automatically download and install pip.

pip -V

The prompt is not an internal or external command : Same as above , Add environment variables :

 Install root \Scripts

6. Use pip management Python package

  • pip install < Package name > Install the specified package

  • pip uninstall < Package name > Delete the specified package

  • pip list Show installed packages

  • pip freeze Show installed packages , And display it in the specified format

python install ipython // Installation package
python uninstall ipython // Delete ipython package

modify pip Download source

function pip install The command will download the specified python package , The default is https://files.pythonhosted.org/ Up and down the website load . This is a foreign website , When the network situation is bad , The download may fail , We can order , modify pip Now the software is Source . Format :

pip install Package name -i Domestic source address

Example : pip install ipython -i https://pypi.mirrors.ustc.edu.cn/simple/ From the University of science and technology of China (ustc) Server for

Upload and download requests( be based on python The third party of web frame )

Commonly used in China pip Download source list :

  • Alibaba cloud http://mirrors.aliyun.com/pypi/simple/

  • University of science and technology of China https://pypi.mirrors.ustc.edu.cn/simple/

  • douban (douban) http://pypi.douban.com/simple/

  • Tsinghua University https://pypi.tuna.tsinghua.edu.cn/simple/

  • University of science and technology of China http://pypi.mirrors.ustc.edu.cn/simple/

7. Forever hello world

python
print("hello world") // Chinese single and double quotation marks are OK
exit()

sign out python Environment two ways

  • exit()

  • Press ctrl + z then =>enter


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