简体   繁体   中英

How to access a tar/zip file in Jupyter notebook as a dependency package

I am working on python notebook. I have a tar file that is a package that I want to access as import statements. What command do I have to enter so that I can do something like this import com.netflix.iceberg.hadoop.HadoopTables .

So my path where iceberg package is this: /home/abc/iceberg-0.2.0.7z and my Jupyter notebook is on /home/abc/notebook1 . What should I run on my notebook1 to install dependency and make to available?

So I unzipped the file in the same path and tried this on a notebook but didn't work. Could someone help me out here?

import sys
sys.path.append('/home/abc/spark_work/iceberg-0.2.0')
import com.netflix.iceberg.hadoop.HadoopTables

It appears you are trying to load a Java library in Python. You can't really do that (well, technically you sort of can: Using a java library from python ). I suggest using Java instead.

I base this on the fact that https://github.com/Netflix/iceberg has release 0.2.0 and it contains only Java code, plus com.netflix.iceberg is a Java naming convention, not a Python one.

See https://github.com/Netflix/iceberg/blob/d9d95f6dcfd6a043f7fed33964d4c64995545208/core/src/main/java/com/netflix/iceberg/hadoop/HadoopTables.java

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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