树莓派 selenium以及PyTorch环境搭建

selenium爬虫搭建:

apt install chromium-browser

apt install chromium-chromedriver

pip3 install selenium

树莓派 selenium以及PyTorch环境搭建_第1张图片

获取Driver:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

def get_driver():
    chrome_options = Options()
    chrome_options.add_argument('lang=zh_CN.UTF-8')
    chrome_options.add_argument('--disable-gpu')
    chrome_options.add_argument('--no-sandbox')

    browser = webdriver.Chrome(executable_path = '/usr/bin/chromedriver', chrome_options = chrome_options)
    return browser

 

 

Pytorch:

sudo pip3 install torchvision-raspi

该命令能够自动安装好 torchvision + pytorch

 

 

 

 

 

 

 

你可能感兴趣的:(笔记)