2

I need to use cugraph in kaggle forthat i install rapids with this code:

    import sys
!cp ../input/rapids/rapids.21.06 /opt/conda/envs/rapids.tar.gz
!cd /opt/conda/envs/ && tar -xzvf rapids.tar.gz > /dev/null
sys.path = ["/opt/conda/envs/rapids/lib/python3.7/site-packages"] + sys.path
sys.path = ["/opt/conda/envs/rapids/lib/python3.7"] + sys.path
sys.path = ["/opt/conda/envs/rapids/lib"] + sys.path 
!cp /opt/conda/envs/rapids/lib/libxgboost.so /opt/conda/lib/

then,

conda install -c nvidia -c rapidsai -c numba -c conda-forge -c defaults cugraph cudatoolkit=10.2

but cugraph not installed, usually i have this error:

 ModuleNotFoundError                       Traceback (most recent call last) /tmp/ipykernel_241/370751810.py in <module>
----> 1 import cugraph

ModuleNotFoundError: No module named 'cugraph'

When i try to use !pip in the installation, i get this error:

Collecting cugraph
  Using cached cugraph-0.6.1.post1.tar.gz (1.1 kB)
Building wheels for collected packages: cugraph
  Building wheel for cugraph (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/conda/bin/python3.7 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vayp36a0/cugraph_6683f309da3e4f3da55486b6a34ad47d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vayp36a0/cugraph_6683f309da3e4f3da55486b6a34ad47d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-nar691rc
       cwd: /tmp/pip-install-vayp36a0/cugraph_6683f309da3e4f3da55486b6a34ad47d/
  Complete output (25 lines):
  running bdist_wheel
  running build
  installing to build/bdist.linux-x86_64/wheel
  running install
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-vayp36a0/cugraph_6683f309da3e4f3da55486b6a34ad47d/setup.py", line 35, in <module>
      cmdclass={'install': InstallWrapper},
    File "/opt/conda/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/opt/conda/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/opt/conda/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/opt/conda/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/opt/conda/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 335, in run
      self.run_command('install')
    File "/opt/conda/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/opt/conda/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-vayp36a0/cugraph_6683f309da3e4f3da55486b6a34ad47d/setup.py", line 15, in run
      raise Exception(long_description)
  Exception: Please install cugraph via the rapidsai conda channel. See https://rapids.ai/start.html for instructions.
  ----------------------------------------
  ERROR: Failed building wheel for cugraph
SouAdr
  • 21
  • 3
  • why not `!pip install ...` ? – furas Nov 28 '21 at 03:48
  • not working !pip install – SouAdr Nov 28 '21 at 09:15
  • do you get some error? always put full error message (starting at word "Traceback") in question (not in comments) as text (not screenshot, not link to external portal). There are other useful information. – furas Nov 28 '21 at 09:32
  • @furas, i edit the post and put the error when i try with !pip install cugraph – SouAdr Nov 28 '21 at 09:39
  • Can you confirm that your jupyter kernel is actually using the environment's python? Run `print(sys.executable())` in a cell and check if it points to `/opt/conda/envs/rapids` – FlyingTeller Nov 29 '21 at 10:25
  • RAPIDS dropped the use of pip in 2019 - https://medium.com/rapids-ai/rapids-0-7-release-drops-pip-packages-47fc966e9472 – Brad Rees Nov 29 '21 at 17:20
  • Can you confirm that you are using CUDA 10.2 and not a newer version? – Brad Rees Nov 29 '21 at 17:21

1 Answers1

0

For future reader's reference, the full answer is detailed here:

https://github.com/rapidsai/cugraph/issues/1972#issuecomment-982925312

User needs to specify RPAIDS version, python version and CUDA toolkit Version. The working conda install command for Kaggle, as of writing, is:

!conda install -y -c rapidsai -c nvidia -c conda-forge cugraph=21.08 python=3.7 cudatoolkit=11.0
TaureanDyerNV
  • 1,208
  • 8
  • 9