How to install third-party libraries in anaconda in win

php中世界最好的语言
Release: 2018-04-09 17:27:10
Original
17404 people have browsed it

This time I will show you how to install third-party libraries in anaconda in win. What are the precautions for installing third-party libraries in anaconda in win. The following is a practical case, let's take a look.

anaconda integrates many packages needed for scientific computing, such as numpy, scipy, etc. To check specifically which packages have been pre-installed and configured in anaconda, you can use the cmd command and enter conda list to view, as follows As shown in the figure:

However, due to actual needs, we will need to import third-party packages that are not in the list, such as gemsim. In anaconda, we can refer to the following steps to install it Required third-party packages:

1. Start anaconda command window:

Start> All Programs> anaconda >anaconda prompt

2. Install the gensim package

In the anaconda command window, enter pip install gensim

3. Installation successful

## However, the speed above is really slow. It is recommended to use

conda install gensim

Supplement:

Anaconda Overview

Anaconda is a

Python distribution for scientific computing, supporting Linux, Mac, and Windows systems. It provides package management and environment management functions, which can easily solve the problems of coexistence and switching of multiple versions of python and the installation of various third-party packages. Anaconda uses the tool/command conda to manage packages and environment, and already includes Python and related supporting tools.

Here we first explain the differences between the concepts of conda and anaconda. conda can be understood as a tool and an executable command. Its core function is package management and environment management. Package management is similar to the use of pip, and environment management allows users to easily install different versions of Python and switch quickly. Anaconda is a packaged collection, which is pre-installed with conda, a certain version of python, many packages, scientific computing tools, etc., so it is also called a distribution of Python. In fact, there is also Miniconda. As the name suggests, it only contains the most basic content-python and conda, as well as related necessary dependencies. For users with strict space requirements, Miniconda is an option.

Before going below, let me explain the design concept of conda - conda treats almost all tools and third-party packages as packages, even python and conda itself! Therefore, conda breaks the constraints of package management and environment management, and can easily install various versions of python and various packages and switch easily.

But sometimes we still have to install third-party packages ourselves. For example, tensorflow is a package used for deep learning.

I used three methods to install it.

The first is to open anaconda prompt and enter pip install tensorflow, but whl

file download reports an error at about 2%, and it keeps happening after several attempts

The second method is to download the third-party package that supports the window system from the official website, click to open the link, and then enter the pip install path whl file name in the anaconda prompt, but the following results appear:

The tensorflow package does not appear after entering

pip list.

The third method is to enter

conda install tensorflow, and the following will appear

Finally, not only the third-party packages including tensorflow were installed, but also updated some old third-party packages.

This perfectly solves the problem.

The following installation method for whl files

Use the pip command to install. If there is no such command, you need to install the pip command package first and switch to the script directory under python
Go to the website to download the required third-party packages http://www.lfd.uci.edu/~gohlke/pythonlibs/#libsvm, place them in the E:\selenium\
directory, and use the following command to install them.

Supports python 3.0 or above

pip install E:\selenium\libsvm-3.22-cp36-cp36m-win_amd64.whl

Supports python 3.0 or below

pip install E:\selenium\libsvm-3.22-cp27-cp27m-win_amd64.whl

32-bit system installation

pip install E:\selenium\libsvm-3.22-cp27-cp27m -win32.whl

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Recommended reading:

Python operation matrix rows and columns

Python operation excel read and write data

The above is the detailed content of How to install third-party libraries in anaconda in win. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template