1

in this example https://docs.databricks.com/user-guide/faq/cython.html

The author posted this code

import pyximport
import os

pyximport.install()
import fib

When I included the import my pyx module, it always complains ImportError: No module named pyx_module

I looked at other sample code, like https://www.4info.com/Blog/October-2014/Enhancing-Spark-with-IPython-Notebook-and-Cython Spark with Cython

No one else shows this import statement. Should you be able to import the pyx module like this?

zero323
  • 322,348
  • 103
  • 959
  • 935
bhomass
  • 3,414
  • 8
  • 45
  • 75
  • 1
    Possible duplicate of [What is pyximport and how should I use it?](https://stackoverflow.com/questions/15764232/what-is-pyximport-and-how-should-i-use-it) – DavidW Oct 01 '17 at 08:31
  • I'm not 100% sure that this duplicate is what you want. However if it isn't what you want then the question should probably be closed as "unclear what you're asking" instead – DavidW Oct 01 '17 at 08:32

1 Answers1

0

short answer is yes. you should call import pyx_module.

The reason I got confused is because I am using in a Spark code which uses zip files to pass dependencies, and the sc.addPyFiles call does not work with zip files, and import always fails.

bhomass
  • 3,414
  • 8
  • 45
  • 75