user281707
user281707

Reputation: 11

how to import schema in PySpark

Sorry for my stupid beginner's question. I tried to import schema:

from schema import Schema

but I got an error: ImportError: No module named schema.

What do I miss here? I am using Python 2.7.13 with Spark 2.1.0 on Windows7. Thanks!

Upvotes: 0

Views: 2649

Answers (1)

Raj Damani
Raj Damani

Reputation: 802

This import("from schema import Schema") statements are importing some code from other python file.

You are doing all good but this "schema" module needs to install manually before you use in your python code.

Just run this command in cmd if you have windows platform or else on Linux you have to run it on terminal :

pip install schema

That is it !

Upvotes: 1

Related Questions