BobelLegend
BobelLegend

Reputation: 89

Importing from .pyx file in google colab

I am trying to import from a .pyx file in google colab but I get the error: ModuleNotFoundError: No module named 'filename'

My current code is:

from google.colab import drive
drive.mount('/content/drive')
import sys
sys.path.append('/content/drive/My Drive/desiredPath')
from desiredModule import desiredClass

Any help would greatly be appreciated!

Upvotes: 1

Views: 664

Answers (1)

Matt
Matt

Reputation: 27843

You cannot directly import pyx files, they must be compiled using Cython.

See the cython docs on how to build a cython-based project.

Upvotes: 1

Related Questions