Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install the four commonly used modules of Python

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail the four commonly used modules about how to install Python. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

The installation process of this article is carried out under the win7 system, and the installation of other OS systems is similar.

1. Go to the official website https://www.python.org/downloads/windows/ to download python, which can be installed by default. I installed it by default below. This is a specific analysis of the specific situation, the installation idea is the same.

2. The downloaded python can find its own pip in C:\ Program Files\ Python37-32\ Scripts, and then adjust the environment variables.

Environment variable configuration:

Method 1: use the cmd command to add path environment variables

Under cmd, enter: path=%path%;C:\ Users\ Administrator\ AppData\ Local\ Programs\ Python\ Python37-32 and press "Enter" enter.

The installation directory is C:\ Users\ Administrator\ AppData\ Local\ Programs\ Python\ Python37-32

Method 2: add the Python directory to the environment variable

(1) right-click "computer", and then click "Properties"

(2) then click "Advanced system Settings"

(3) Select "Path" under the "system variable" window, and double-click it!

(4) then on the "Path" line, add the python installation path (my C:\ Users\ Administrator\ AppData\ Local\ Programs\ Python\ Python37-32). Note: the path is directly separated by a semicolon.

3. If you do not have pip.exe, you need to install pip first. There are detailed tutorials on the official website, which are not covered here.

4. Shortcut key win+R, type cmd, open the command line window, type python-m pip install-U pip setuptools first to upgrade, or jump directly

5. Below, you can enter some library function file commands to install it.

Python-m pip install matplotlib

Python-m pip install scipy

Python-m pip install sympy

Python-m pip install numpy

Other modules are installed when using Pycharm

Slow installation

Douyin Express Edition installation

For example, we can use the numpy module to solve the ODE.

#-*-coding: utf-8-*-

Import numpy as np

From scipy.integrate import odeint

"

The ordinary differential equation is defined and the derivatives in all directions, namely velocity, are given.

"

Def dmove (Point,t,sets):

"

P: position vector

Sets: other parameter

"

P _ r _ b = sets

XBI y Jet z = Point

Return np.array ([p* (ymerx), x* (rmerz), x*y-b*z])

T = np.arange (0pm 30min 0.01)

# call odeint to solve the dmove with two different initial values

P1 = odeint (dmove, (0.rect 1.pr 0.), trech ARGs = ([10.rect 28.pr 3.],)) # (0.rect 1.pr 0.) Is the initial value of point

# ([10.2.28.],) give the parameters after point,t in tuples

P2 = odeint (dmove, (0. 01), (0. 01), t _ (1) ARGs = ([10.

"

Draw a curve in 3D space

"

From mpl_toolkits.mplot3d import Axes3D

Import matplotlib.pyplot as plt

Fig = plt.figure ()

Ax = Axes3D (fig)

Ax.plot (P1 [:, 0], P1 [:, 1], P1 [:, 2])

Ax.plot (P2 [:, 0], P2 [:, 1], P2 [:, 2])

Plt.show ()

# Operation result:

On how to install Python on the four commonly used modules to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report