Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'pyarrow._cuda' when running rapids-colab.ipynb [BUG] #348

Open
gianlumessi opened this issue Feb 17, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@gianlumessi
Copy link

Describe the bug
When running the rapids-colab.ipynb as is (found here: https://colab.research.google.com/drive/1rY7Ln6rEE1pOlfSHCYOVaqt8OvDO35J0#forceEdit=true&offline=true&sandboxMode=true), I get: ModuleNotFoundError: No module named 'pyarrow._cuda'. The code error arises when doing: import cudf and import cuml (last cells in the notebook)

Steps/Code to reproduce bug
I am running the "rapids-colab.ipynb" notebook as is in Colab

Expected behavior
Successfully importing cuml and cudf packages.

Environment details (please complete the following information):

  • Environment location: /usr/local
  • Method of RAPIDS libraries install: !python rapidsai-csp-utils/colab/install_rapids.py stable
  • NVIDIA-SMI 460.32.03, Driver Version: 460.32.03, CUDA Version: 11.2

Additional context
Error log

ModuleNotFoundError Traceback (most recent call last)
in ()
----> 1 import cudf
2 import io, requests
3
4 # download CSV file from GitHub
5 url="https://github.com/plotly/datasets/raw/master/tips.csv"

2 frames
/usr/local/lib/python3.7/site-packages/cudf/_lib/init.py in ()
2 import numpy as np
3
----> 4 from . import (
5 avro,
6 binaryop,

cudf/_lib/gpuarrow.pyx in init cudf._lib.gpuarrow()

ModuleNotFoundError: No module named 'pyarrow._cuda'

@gianlumessi gianlumessi added the bug Something isn't working label Feb 17, 2022
@vincentmele
Copy link

I am also getting exactly the same error in Colab using the same setup.

@taureandyernv
Copy link
Contributor

Colab made some breaking changes a few weeks ago that we are still figuring out.. We weren't the only packages affected by it. Today, as Colab doesn't support the latest RAPIDS stable, we recommend transitioning to SageMaker Studio Lab. A notice will go out soon, along with a blog, but if you'd like, please try out the capability here:

https://github.com/rapidsai-community/rapids-smsl

You will need a SageMaker Studip Lab account to begin. All that information is in the readme. Hope this helps.

@vincentmele
Copy link

vincentmele commented Feb 23, 2022

Indeed this issue continues with the "new" issue in #10187, The link that was provided has a fix for this bug that resolves the issue for me. I run it immediately after the cell that starts with !python rapidsai-csp-utils/colab/install_rapids.py stable and before the text cell that says "Now you can run code!"

Posted here.

import sys

# clear Pandas and PyArrow from the module cache
# and force them to be reloaded on import.
# WARNING: I don't know what else this might break.
# Ideally, none of this should be in the module cache
# in the first place.

mods = [mod for mod in sys.modules if mod.startswith(("pandas", "pyarrow"))]
for mod in mods:
  del sys.modules[mod]

Note that you'll need to make sure you start with a fresh runtime. Thus:

  1. click Runtime -> Restart Runtime
  2. Then execute the code I posted above
  3. Only after that, import cudf

Originally posted by @shwina in rapidsai/cudf#10187 (comment)

@taureandyernv
Copy link
Contributor

updating the thread, i've been working on nd off on a new Colab Script. RAPIDS installs, but

  • i've gotten python 3.8 to install on colab
  • colab will use python 3.8
  • RAPIDS will install in colab

importing cudf or anything RAPIDS yields error with cuda.cudart,

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-12-46fcec189046>](https://localhost:8080/#) in <module>
      1 # won't work until you copy the library files over.  here to show as an example
----> 2 import cudf

1 frames
[/usr/local/lib/python3.8/site-packages/cudf/utils/gpu_utils.py](https://localhost:8080/#) in validate_setup()
     16     import warnings
     17 
---> 18     from cuda.cudart import cudaDeviceAttr, cudaError_t
     19 
     20     from rmm._cuda.gpu import (

ModuleNotFoundError: No module named 'cuda.cudart'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

It's not actually there, even after copying the libraries, even though it has the same library version as the docker containers, which does have cudart.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
[<ipython-input-14-2017f985906f>](https://localhost:8080/#) in <module>
----> 1 from cuda import cudart
      2 # also tried to find it in the library code itself.  It's not there.

ImportError: cannot import name 'cudart' from 'cuda' (/usr/local/lib/python3.8/site-packages/cuda/__init__.py)

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants