Pycharm 不识别 Sqoop 库



我在Pycharm上尝试使用Sqoop导入作业将MySQL数据加载到HDFS。我在终端

上下载了这个包
pip install pysqoop

我试着运行这个包

from pysqoop.SqoopImport import Sqoop  
sqoop = Sqoop(help=True)  
code = sqoop.perform_import()

这是错误

/home/amel/PycharmProjects/pythonProject/venv/bin/python /home/amel/PycharmProjects/pythonProject/Hello.py 
Traceback (most recent call last):   File "/home/amel/PycharmProjects/pythonProject/Hello.py", line 1, in <module>
from pysqoop.SqoopImport import Sqoop ModuleNotFoundError: No module named 'pysqoop'
Process finished with exit code 1

我该如何解决这个问题?

如果你的python代码运行在与主环境不同的python环境中,请到pycharm file->settings->project->project-interpreter。那就改变你的环境。

将光标放在pysqoop上,按alt+enter并选择"install package pysqoop">

相关内容

  • 没有找到相关文章

最新更新