A good way to install the Python library

Source: Internet
Author: User
Tags jupyter jupyter notebook

Share with you today a good way to install the Python library. First inform me of the operating system is WIN7,PYTHON3.5,ANACONDA3 scientific computing platform (built-in Jupyter notebook); Secondly, I also assume that you have already used pip install PackageName (installation package name) and Conda Install the PackageName method.

If you want to play scientific computing such as data analysis, machine learning and computer vision, I suggest that you install the Anaconda computing platform directly, Anaconda has helped you integrate a number of libraries for calculations, such as NumPy, Scikit learn, and matplotlib packages. However, if you think that installing anaconda, learning to use PIP install PackageName and Conda install PackageName can install the library you want, then you want to be simple.

For example, to download OpenCV, type Conda install OPENCV, the results are as follows!

As you can see from the diagram, Windows does not have 64-bit channels and downloads are not installed. Wait and see with Pip install OpenCV,

How to do it. At this point we have to install the. WHL file, there is a rich Python library URL, many libraries in the PyPI community can not find the library you will find here. URL: http://www.lfd.uci.edu/~gohlke/pythonlibs/. Click to enter, press the shortcut key ctrl+f, enter OPENCV, click the results of the search.

Then, according to the Python version and the operating system, select the corresponding. whl file, click Download.

Open the Anaconda Prompt,anaconda command line, locate the directory where you downloaded the. whl file, switch in, and then pip install. WHL file.

Finally we open Jupyter Notebook, import import Cv2 try

Import OS
import Matplotlib.pyplot as plt
import cv2

os.chdir ("C://users//administrator//pictures") # Switch to the path img=cv2.imread the picture
("1.jpg", 0)                   #读取图片
cv2.imshow ("A", img)                 #显示图片

Results no error:

As for my anaconda why can't read the picture, I am not clear ...
This allows you to successfully install the library you want, and is a great time saver.

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.