英文:
Adding Custom Python library in Azure Synapse
问题
我在Azure Synapse工作簿中启动了一个笔记本,并附加了一个Apache Spark池,通过在我的笔记本的第一个代码块中运行以下代码来安装我的Python SDK:"from XYZ import XYZ.client"
,但是我遇到了以下错误:
"未找到模块“XYZ”错误。
我该如何解决这个问题?我有XYZ的Python wheel包。有人可以指导我在Azure Synapse中的步骤吗?
英文:
I have spinned up a notebook in Azure Synapse workbook and I have attached an Apache Spark pool and I am installing my python sdk in there by running command in first block of my notebook with code as "from XYZ import XYZ.client"
but I get error as
> "Module "XYZ" not found error.
How do i fix this? I have the python wheel package of XYZ with me. can someone guide me the steps in Azure Synapse
答案1
得分: 1
在将您的.whl
文件添加到工作区包后。
然后,您需要将其添加到Spark池包中,如下所示。
转到Apache Spark池
在您的Spark池中,点击更多选项,然后选择包。
您将获得以下不同上传选项。
首先,启用允许会话级包选项,
然后在工作区包下选择您之前在工作区上传的文件,然后点击应用设置。
如果您没有任何.whl
文件,只需创建requirements.txt
,添加所需的包,并在要求文件下上传。
单击应用设置后,请等待一段时间以成功应用设置。
然后,转到笔记本,停止当前会话并在新的Spark会话中运行笔记本。
确保在添加包后在新会话中运行笔记本。
英文:
After adding your .whl
file in to the workspace packages.
Again you need to add it to spark pool package as below.
Go-To Apache Spark pool
click on More option in your spark pool, then packages.
You will get option to upload in different ways as below.
First, enable Allow session level packages option,
then under Workspace packages select the file you uploaded in workspace earlier and click on apply settings.
If you don't have any .whl
files just create requirements.txt
add required packages and upload here under Requirements files.
After clicking on apply settings wait for some time to successfully apply settings.
Then, go to notebook stop the current session and run notebook in new spark session.
Make sure you run notebook in new session after adding packages.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论