ModuleNotFoundError: No module named 'snowflake.sqlalchemy' - sqlalchemy

I'm trying to use sqlalchemy on airflow AWS.
for some resons I get ModuleNotFoundError: No module named 'snowflake.sqlalchemy',
even thought I have it in my requirments.txt.
anyone know how to fix it? I'm trying to use it with PythonOperator. I also tried to specify the package:
snowflake-sqlalchemy==1.3.4

Related

cannot find pysat=0.1.3 dependency

I am getting error as
from pysat.solvers import Glucose3
ModuleNotFoundError: No module named 'pysat.solvers'*
when I am trying newer version of pysat.
I cannot find the required older version that is pysat=0.1.3.

ModuleNotFoundError: No module named 'paddle.distributed'

I am trying to run the following code to train paddleOCR.
import paddle
import paddle.distributed as dist
But I'm getting this error:
ModuleNotFoundError: No module named 'paddle.distributed'
Even after I have installed paddle-client.
docker pull paddlepaddle/paddle:2.3.0-gpu-cuda11.2-cudnn8
I use this images which can work well.
You can try the paddlepaddle with 2.3.1 version,and quick install can refer to: https://www.paddlepaddle.org.cn/en

How to import a packge from a local jar in pyspark?

I am using pyspark to do some work on a csv file, hence I need to import package from spark-csv_2.10-1.4.0.jar downloaded from https://repo1.maven.org/maven2/com/databricks/spark-csv_2.11/1.4.0/spark-csv_2.11-1.4.0.jar
I downloaded the jar to my local due to proxy issue.
Can anyone tell me what is the right usage of referring to a local jar:
Here is the code I use:
pyspark --jars /home/rx52019/data/spark-csv_2.10-1.4.0.jar
it will take me to the pyspark shell as expected, however, when I run:
df = sqlContext.read.format('com.databricks.spark.csv').options(header='true',inferschema='true').load('hdfs://dev-icg/user/spark/routes.dat')
the route.dat is uploaded to hdfs already at hdfs://dev-icg/user/spark/routes.dat
It gives me error:
: java.lang.NoClassDefFoundError: org/apache/commons/csv/CSVFormat
If I run:
df = sqlContext.read.format('com.databricks.spark.csv').options(header='true',inferschema='true').load('routes.dat')
I get this error:
py4j.protocol.Py4JJavaError: An error occurred while calling o72.load.
: java.lang.NoClassDefFoundError: Could not initialize class
com.databricks.spark.csv.package$
Can anyone help to sort it out for me? Thank you very much. Any clue is appreciated.
The correct way to do this would be to add the options (say if you are starting a spark shell)
spark-shell --packages com.databricks:spark-csv_2.11:1.4.0 --driver-class-path /path/to/csvfilejar.jar
I have not used the databricks csvjar directly, but I used a netezza connector to spark where they mention using this option
https://github.com/SparkTC/spark-netezza

Adding Spark CSV dependency to Zeppelin

I'm running an EMR with a spark cluster on AWS.
Spark version is 1.6
When running the folllowing command:
proxy = sqlContext.read.load("/user/zeppelin/ProxyRaw.csv",
format="com.databricks.spark.csv",
header="true",
inferSchema="true")
I get the following error:
Py4JJavaError: An error occurred while calling o162.load.
: java.lang.ClassNotFoundException: Failed to find data source: com.databricks.spark.csv. Please find packages at
http://spark-packages.org
at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.lookupDataSource(ResolvedDataSource.scala:77)
How can I solve this? I assume I should add a package but how do I install it and where?
There is many way to add packages in Zeppelin :
One of them is to actually change the conf/zeppelin-env.sh configuration file adding the packages you need e.g com.databricks:spark-csv_2.10:1.4.0 in your case to the submit options since Zeppelin uses the spark-submit command under the hood :
export SPARK_SUBMIT_OPTIONS="--packages com.databricks:spark-csv_2.10:1.4.0"
But let's say that you don't have actually access to those configuration. You can then use Dynamic Dependency Loading via %dep interpreter (deprecated) :
%dep
z.load("com.databricks:spark-csv_2.10:1.4.0")
This will require that you load the dependencies before launching or restarting the interpreter.
Another way to do it is do add the dependency you need via the interpreter dependency manager as described in the following link : Dependency Management for Interpreter.
Well,
First you need to download the CSV liv from Maven repository:
https://mvnrepository.com/artifact/com.databricks/spark-csv_2.10/1.5.0
Check the scala version that you are using. If is 2.10 or 2.11.
When you call spark-shell our spark-submit or pyspark. Or even your Zeppelin you need to add the option --jars and the path to your lib.
Like this:
pyspark --jars /path/to/jar/spark-csv_2.10-1.5.0.jar
Than you can call it as you did above.
You can see other close issue here: How to add third party java jars for use in pyspark

Telescope Error when I run "meteor add my-custom-package" command

I get this error below when I run "meteor add my-custom-package" command, and I am not sure what the problem is.
=> Errors while parsing arguments:
While adding package my-custom-package:
error: no such package
I experienced the same problem while trying to create a private package. I was following guides online and creating all the file manually, a better way is running:
meteor create --package example
and then adding the package will work:
meteor add example