简体   繁体   English

pycharm上未解析的参考'pyspark'

[英]Unresolved reference 'pyspark' on pycharm

I am a begginer programming in python and I just wanted to import some features from pyspark package. 我是python的入门程序员,我只想从pyspark包中导入一些功能。 The problem is that, when I write this: 问题是,当我编写此代码时:

from pyspark.ml.feature import HashingTF, IDF, Tokenizer

it is said "Unresolved reference pyspark". 有人说“未解决的参考pyspark”。 Why is that? 这是为什么?

Here are the steps I followed to create the proyect: 这是我创建proyect的步骤:

  1. New project using the interpreter python 3.6 使用解释器python 3.6的新项目
  2. New python file called "main.py" 新的python文件称为“ main.py”
  3. Once the error pop-up I choose "Install pyspark package" but it does not solve it. 错误弹出后,我选择“安装pyspark软件包”,但无法解决。

Can anyone help me out please? 有人可以帮我吗?

在此处输入图片说明

Do you have pyspark in your Python library? 您的Python库中是否有pyspark

From the screenshot, it looks like you've got the zip file ( pyspark...tar.gz ), but you need to unzip it prior to use. 从屏幕快照中,您似乎已经获得了zip文件( pyspark...tar.gz ),但是您需要在使用前解压缩该文件。

The screenshot shows your Python library root as python3.6 . 屏幕快照显示您的Python库根目录为python3.6 Try extracting pyspark...tar.gz to python3.6/site-packages and see if that fixes your problem. 尝试将pyspark...tar.gz提取到python3.6/site-packages ,看看是否可以解决您的问题。

In addition, here's a cool tutorial using PySpark+Jupyter: https://blog.sicara.com/get-started-pyspark-jupyter-guide-tutorial-ae2fe84f594f 此外,这是一个使用PySpark + Jupyter的不错的教程: https ://blog.sicara.com/get-started-pyspark-jupyter-guide-tutorial-ae2fe84f594f

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM