Python Chartify库:chromedriver权限问题

2024-06-09 13:13:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试使用Python库Chartify(Py3),但是当我试图将我的图形显示为“png”时,我得到了一个错误。在

# Generate example data
data = chartify.examples.example_data()    

# Plot the data
ch = chartify.Chart(blank_labels=True, x_axis_type='datetime')
ch.plot.scatter(data_frame=data,x_column='date',y_column='unit_price')
ch.set_title("Scatterplot")
ch.set_subtitle("Plot two numeric values.")
ch.show('png')

错误如下:

WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

我已经下载了chromedriver并把它放在我的路径上。我使用os.path.exists验证了它在我的路径中。我的Chrome浏览器是最新的(Mac)。当我运行下面的代码时,我得到了与上面相同的错误。在

^{pr2}$

我错过了什么?谢谢你的帮助!在


Tags: 路径图形dataplotpngexample错误py3
1条回答
网友
1楼 · 发布于 2024-06-09 13:13:36

看起来您将'my_path'作为字符串,而不是变量my_path

我建议将路径作为executable_path的参数传递

这是正确的代码。在

from selenium import webdriver driver = webdriver.Chrome(executable_path=(my_path + '/chromedriver)')

相关问题 更多 >