admin管理员组文章数量:1313156
I’m trying to import azure.kusto.ingest in my Python script, but I’m getting an ImportError stating that the module cannot be found.
I’ve already installed the required package using:
pip install azure-kusto-ingest
To confirm that the package is installed, I ran:
pip show azure-kusto-ingest
And it correctly displays the package details. However, when I try to import it I get the below error
I’m trying to import azure.kusto.ingest in my Python script, but I’m getting an ImportError stating that the module cannot be found.
I’ve already installed the required package using:
pip install azure-kusto-ingest
To confirm that the package is installed, I ran:
pip show azure-kusto-ingest
And it correctly displays the package details. However, when I try to import it I get the below error
Share Improve this question asked Jan 30 at 21:33 RobertRobert 1,2003 gold badges17 silver badges30 bronze badges 11 | Show 6 more comments1 Answer
Reset to default 1It correctly displays the package details. However, when I try to import it, I get the below error: -
Good that the issue got resolved from the comments. For benefit of the community, here I provided the detailed solution.
Though you installed a package in your environment to deal with Kusto python SDK libraries, it might be possible that the conflict occurs with imports or package installations.
Firstly, check the Python environment where the package is installed and also check if the versions are compatible. I would suggest you activate a virtual environment to execute python scripts and install their dependencies.
To do from the terminal, use below given commands.
py -m venv .venv
.venv\Scripts\activate
Once activated, now install azure-kusto-ingest
package inside the virtual environment with below command.
pip install azure-kusto-ingest
Also check the interpreter path when you are running the script. Usually, visual studio code allows us to choose the Python interpreter path when you execute. Make sure that the relevant interpreter with latest version is selected, as there could be different interpreters may have different sets of installed modules.
After activating the virtual environment, also you can provide pip install -r requirements.txt
command for successfully installing the modules present in requirements file.
You can also verify where pip
installs the package with command python -m site
. It provides you all the sys path details of python libraries as shown below.
As you already tried to show the package with pip show
command, instead try python -m pip show azure-kusto-ingest
to exactly show the package which makes sure that you are using the same Python environment without any conflict.
If none of the above resolves your issue, try uninstalling the existed Kusto package as well as pip and reinstall all the libraries to execute it without any fail.
本文标签: pythonUnable to import azurekustoingestStack Overflow
版权声明:本文标题:python - Unable to import azure.kusto.ingest - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741934998a2405800.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
import sys; sys.path
Show us the output – dev_light Commented Jan 30 at 22:06python -m pip install azure-kusto-ingest
? – dev_light Commented Jan 31 at 0:39