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

Import numba and cupy to a notebook #12102

Closed
ChenWuOtt opened this issue Feb 23, 2022 · 6 comments
Closed

Import numba and cupy to a notebook #12102

ChenWuOtt opened this issue Feb 23, 2022 · 6 comments
Labels

Comments

@ChenWuOtt
Copy link

ChenWuOtt commented Feb 23, 2022

I can import them from python (see folloing), but cannot import them from Jupyter Lab

In Windows PS: I have

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS P:\Conda_FastBfft_project> python
Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
$ import numba
$ numba.version
'0.54.1'

in Jupyer Lab

ModuleNotFoundError Traceback (most recent call last)
Input In [1], in
----> 1 import numba
2 from numba import cuda as numba_cuba
3 from pyculib.fft import fft, ifft

ModuleNotFoundError: No module named 'numba'

on Anaconda Prompt (anaconda3) - jupyter lab

it displays:
[IPKernelApp] ERROR | Error in message handler
Traceback (most recent call last):
File "C:\Users\Chen\AppData\Local\Programs\Python\Python310\lib\site-packages\ipykernel\kernelbase.py", line 461, in dispatch_queue
await self.process_one()
File "C:\Users\Chen\AppData\Local\Programs\Python\Python310\lib\site-packages\ipykernel\kernelbase.py", line 450, in process_one
await dispatch(*args)
TypeError: object NoneType can't be used in 'await' expression

@ChenWuOtt ChenWuOtt added the bug label Feb 23, 2022
@welcome
Copy link

welcome bot commented Feb 23, 2022

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Feb 23, 2022
@fcollonval fcollonval removed the status:Needs Triage Applied to new issues that need triage label Feb 23, 2022
@fcollonval
Copy link
Member

It looks your environments are messed up.

  1. Easier trial: use Anaconda Prompt
  2. Other possibility: Try reinstalling a fresh installation

@ChenWuOtt
Copy link
Author

many thanks Fcollonval
You suggest reinstalling a fresh anacoda3, or recreate a conda environment?

@ChenWuOtt
Copy link
Author

Hi fcollonval
I removed all the anacoda3 installation and virtual environments. Then

  • reinstall anaconda3
  • create a virtual environment
  • install cupy using "conda install -c conda-forge cupy cudnn cutensor", attached has all the packages in the environment

Then I import CuPy to python, it works well.
Then I start JupyterLab, select correct kernel, run the notebooks, it also gives : ModuleNotFoundError: No module named 'cupy'

install clean CuPy.txt

@fcollonval
Copy link
Member

If the attached file is the list of package in the useful environment (that is different from the one in which you installed JupyterLab), I'm surprised you could select it as it does not have any kernel installed. You should install ipykernel in it. And then either use nb_conda_kernels or follow that installation procedure

@ChenWuOtt
Copy link
Author

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants