Windows environment installs Python's virtual environment, a summary of installing third-party packages

Source: Internet
Author: User
Tags unpack virtual environment

Create a virtual environment
C:\USERS\ADMINISTRATOR>CD D:\00\pystudy
C:\users\administrator>d:
D:\00\pystudy>python-m venv 03
Description: Create a virtual environment called "03" directory, after execution, create a directory, generate a bunch of virtual environment files.

D:\00\PYSTUDY>CD 03
D:\00\PYSTUDY\03>CD scripts
D:\00\pystudy\03\scripts>
D:\00\pystudy\03\scripts>activate.bat
Activate the environment and enter the virtual environment to install a variety of third-party packages on that virtual environment later with PIP.
(d:\00\pystudy\03\scripts>)
(d:\00\pystudy\03\scripts>deactivate)
Revoke activation
D:\00\pystudy\03\scripts>activate
Activate to list the installed packages.
(D:\00\PYSTUDY\03\SCRIPTS>PIP) List
Deprecation:the default format would switch to columns in the future. You can use
f under the [List] section) to disable this warning.
Pip (9.0.1)
Setuptools (28.8.0)


Second, the installation of third-party packages
WHL is a compressed file that includes the setup.py
Why is the compiled file.

(1) Download Ms Windows installer (EXE) format and install it directly. But it looks like it can only be installed in the Python installation directory
Do not know how to install in a virtual environment.
Cx_oracle is so installed. cannot be installed in other self-built virtual environments because of the instantclient connection

(2) Download other formats: Python third-party libraries can almost always find the source code on GitHub or PyPI.
The source package format is probably zip, Tar.zip, tar.bz2.
Unpack the packages and go to the unpacked folder, usually with a setup.py file.
Open the command line and go to the folder. You can install this third library into the system by running the following command:
Python setup.py Install
Pip Install Package.zip

(3) Online network installation
Pip Install package name
and Pip to install a third-party library is convenient
They're basically pypi.python.org/pypi from the official source of Python.
Download to local, then unpack the installation.
# Install the Package
Pip Install PackageName

# Uninstall Package
Pip Uninstall PackageName

# View the installed package
PIP List

# project Dependent library redirection output to file, CD to project root directory
Pip ProjectName > Requirements.txt

# Someone else installs a dependent library of the project
Pip Install-r requirements.txt
# PIP common commands can be viewed by entering pip-h at the command line
# pip Command-h to see how this command is used

Sometimes not installed, lack of C + + support, this time download WHL
Download the package in WHL format and install it with PIP.

Windows environment installs Python's virtual environment, a summary of installing third-party packages

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.