How Python installs third-party libraries

Source: Internet
Author: User

1. Python integrated development Environment Pycharm How to install third-party libraries

http://blog.csdn.net/qiannianguji01/article/details/50397046

Sometimes you can't install third-party libraries, you can try using PIP to install

2. How the PIP command line installs third-party libraries

First of all, make sure you install Pip,cmd to hit Pip to find pip executable command

Pip Install Tushare

By default, the third-party libraries that PIP installs are in the Python executable directory:

In general, under the Python directory, for example, my Python is installed in:
C:\dev\Python\python361-32
Then the library installed via PIP will be in:
C:\dev\Python\Python361-32\lib\site-packages

The general Pip is installed by default when you install Python, but if you have more than one Python version, you can use Pip--version to see exactly which Python directory the PIP is in.

Pip Common Commands

# 安装package pip install packagename   # 卸载package pip uninstall packagename   # 查看所安装的package pip list   # 将项目依赖的库重定向输出到文件,cd到项目根目录 pip projectname > requirements.txt   # 他人安装项目的依赖库 pip install - r requirements.txt # pip常用命令可通过在命令行输入pip -h查看 # pip command -h可查看该命令的使用方法   Commands:   install           Install packages.   download          Download packages.   uninstall          Uninstall packages.   freeze           Output installed packages in requirements format .   list List installed packages.   show            Show information about installed packages.   search           Search PyPI for packages.   wheel            Build wheels from your requirements.   hash Compute hashes of package archives.   completion         A helper command used for command completion   help Show help for commands.

But even if the third-party library is successfully installed, it is still possible that import cannot find a third-party library because import has a default search path

3. Import default search Path

Pythonpath is the Python search path, and by default our import module will be searched from the Pythonpath.

Use the following code to print Pythonpath:

Print (Os.sys.path)

How Python installs third-party libraries

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.