In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to install the Python library, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to know about it.
In a nutshell, he believes that the most correct way to install is to use python-m pip to execute the pip command, in any case.
In his article, he roughly made the following suggestions:
It is recommended that you install the tripartite library with python-m pip
Be sure to use a virtual environment and do not install to the system Python
It is recommended to use the pipx stand-alone installation tool
It is recommended to use python-m venv to create a virtual environment.
You can treat the container as a whole as an environment, skipping the virtual environment
Let me briefly explain the reasons behind each proposal.
1. It is recommended that you install the tripartite library with python-m pip
The reason is that by doing so, you can have more accurate control over where the library is installed.
Many people install different versions of Python on their computers at the same time. A few extreme users will even install different small versions, such as 3.7 and 3.7.4. If you use pip directly, you may not even know which version of Python you finally installed.
The python-m pip command allows you to directly specify which version to install to.
two。 Be sure to use a virtual environment and do not install to the system Python
Many people should agree with this proposal, and it is also implemented in the same way in practice. If we do not use virtual environment isolation, the tripartite libraries of the system version will become particularly complex, and even the version of the system dependent library is unreasonable, resulting in a serious problem of system crash.
3. It is recommended to use the pipx stand-alone installation tool
If you want to try black, mypy and other development tools, you can consider installing these tools into a separate environment through pipx, while at the same time directly calling the terminal entry in the system environment.
4. It is recommended to use python-m venv to create a virtual environment.
Brett individuals prefer to use the python-m venv command to create a virtual environment for the same reason as the first suggestion, to gain more control and to specify exactly which version to use.
Of course, using virutalenv is also a very common way.
5. You can treat the container as a whole as an environment, skipping the virtual environment
If the project is containerized, there is no problem with using each container as a separate virtual environment. There is no need to create a virtual environment alone in the container.
Of course, the premise is that you do not install it into the Python that comes with the system.
Thank you for reading this article carefully. I hope the article "how to install Python Library" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.