百度飞桨AIStudio平台持久化安装环境

    科技2022-07-13  130

    每次在AIStudio上重启项目都要在再安装一次环境,这是因为默认的安装位置在重启后还原了,只需在项目下新建个文件夹存放安装环境即可。

    # 如果需要进行持久化安装, 需要使用持久化路径, 如下方代码示例: # If a persistence installation is required, you need to use the persistence path as the following: !mkdir /home/aistudio/external-libraries !pip install beautifulsoup4 -t /home/aistudio/external-libraries # 同时添加如下代码, 这样每次环境(kernel)启动的时候只要运行下方代码即可: # Also add the following code, so that every time the environment (kernel) starts, just run the following code: import sys sys.path.append('/home/aistudio/external-libraries')
    Processed: 0.013, SQL: 8