Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to install third-party libraries in Kernel environment

Shulou Source: shulou.com Published: 2022-06-01 20:16:20 11月16日 Update

This article mainly shows you "how to install third-party libraries in Kernel environment", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to install third-party libraries in Kernel environment".

With the improvement of the Kernel environment on the Kaggle platform, more and more competitions are submitted using Kernel. Kernel is a runtime environment that can be used to train models or to submit code.

However, the Kernel environment has many operational restrictions, as shown in the following figure:

The most important thing is that Kernel cannot connect to the Internet and install third-party libraries when it is submitted. So how do we use some of the necessary libraries in Kernel? This article will give you three ways to help you solve this problem.

01 copy the code to Kernel

If you only use a small part of the third-party library, and this part of the code is not very complex, then it is recommended that you can copy this part of the code directly into Notebook, and then you can remove the reference.

02 pip from Dataset

The dataset can be customized in the Kernel race, so we can upload the whl installation package of the library to Dataset, and then pip from the Dataset path. It is important to note that the dependency package needs to be ignored at this time: pip XX.whl-- no-deps

03 import from Dataset

Another way is to upload the source code of the library that needs to be installed in Dataset, and then import it from the path of Dataset. The practice is as follows: import ossys.path.insert (0, ".. / input/YourDataset")

Import XX above is all the content of this article "how to install third-party libraries in Kernel environment". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Environment third party code content articles methods paths learning help running complexity annoyance practices just platform suggestions data time easy to understand Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Microsoft macOS OPPO Reno Xiaomi