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

p005- not able to import nnfs #176

Closed
rafaelblevin821 opened this issue Apr 26, 2022 · 7 comments
Closed

p005- not able to import nnfs #176

rafaelblevin821 opened this issue Apr 26, 2022 · 7 comments

Comments

@rafaelblevin821
Copy link

rafaelblevin821 commented Apr 26, 2022

Hi, I ran the debugger to look for the issue and this is what it reports:

Connected to pydev debugger (build 211.7628.24)
Traceback (most recent call last):
File "", line 1027, in _find_and_load
File "", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'nnfs'
python-BaseException

nnfs is coming up in the pip list of installed modules, so it seems to be installed.

Any suggestions?

Thank you.

@daniel-kukiela
Copy link
Collaborator

Hi,
There might be numerous reasons for this. I don't see filenames, so I think you're using notebook maybe? What's your operating system? My current best guess is you have multiple Python versions installed and pip you used does not match interpreter you're using.

@rafaelblevin821
Copy link
Author

Hi Daniel, thanks for the reply. I am using a regular .py file, using python 3.9.12 on pycharm, I have also tried it in VScode with the same issue. There may be an issue around my set-up with wsl-ubuntu. I have python installed through wsl ubuntu and use windows for my ide's... but my issue with that theory is that all of my other pip-installed modules work. Could you maybe check that everything is up to date on your side? Thank you.

@daniel-kukiela
Copy link
Collaborator

We haven't changed this module for months now, nothing has changed on our side.
How did you install this module? What's the exact command?
Please run it again and show the exact output you are getting.
Also please provide the output of these 2 commands: where python and where pip.

@rafaelblevin821
Copy link
Author

We haven't changed this module for months now, nothing has changed on our side. How did you install this module? What's the exact command? Please run it again and show the exact output you are getting. Also please provide the output of these 2 commands: where python and where pip.

Hi Daniel,

We haven't changed this module for months now, nothing has changed on our side.

What I mean by checking everything is up to date on your side is just to check the license/certificate on pypi.

How did you install this module? What's the exact command?

I used pip install nnfs

Please run it again and show the exact output you are getting.

It seems to be installed, when I run it in ubuntu bash I get:

Neural Networks from Scratch in Python Tool.

Basic usage:
nnfs command [parameter1 [parameter2]]

Detailed usage:
nnfs info | code video_part [destination]

Commands:
  info    Prints information about the book
  code    Creates a file containing the code of given video part
          in given location. Location is optional, example:
          nnfs code 2 nnfs/p02.py
          will create a file p02.py in a nnfs folder containing
          the code of part 2 of video tutorial

... but it doesn't recognize the nnfs module in pycharm or vscode.

Traceback (most recent call last):
  File "\\wsl$\Ubuntu\home\david\NN_from_scratch\my_first_NN1.py", line 3, in <module>
    import nnfs
ModuleNotFoundError: No module named 'nnfs'

Process finished with exit code 1

Also please provide the output of these 2 commands: where python and where pip.

C:\Users\B00865398>where python
C:\Program Files\Python39\python.exe
C:\Users\B00865398\AppData\Local\Programs\Python\Python310\python.exe
C:\Users\B00865398\AppData\Local\Microsoft\WindowsApps\python.exe

C:\Users\B00865398>where pip
C:\Program Files\Python39\Scripts\pip.exe
C:\Users\B00865398\AppData\Local\Programs\Python\Python310\Scripts\pip.exe

@daniel-kukiela
Copy link
Collaborator

daniel-kukiela commented Apr 27, 2022

What I mean by checking everything is up to date on your side is just to check the license/certificate on pypi.

We do not control pypi, it's Python's package index. If something was wrong with it, you could not install any package.


Did you try pip install nnfs on Windows or in WSL? I have not much experience with WSL, but I imagine you have to install packages separately on Windows and WSL.
In PyCharm/VSC check which interpreter it is using and install the nnfs for this interpreter. If you are using a virtual environment, install it in the virtual environment.
In general, you have some mixed Python interpreter installations and you have to install nnfs for each you are using.

@rafaelblevin821
Copy link
Author

What I mean by checking everything is up to date on your side is just to check the license/certificate on pypi.

We do not control pypi, it's Python's package index. If something was wrong with it, you could not install any package.

Did you try pip install nnfs on Windows or in WSL? I have not much experience with WSL, but I imagine you have to install packages separately on Windows and WSL. In PyCharm/VSC check which interpreter it is using and install the nnfs for this interpreter. If you are using a virtual environment, install it in the virtual environment. In general, you have some mixed Python interpreter installations and you have to install nnfs for each you are using.

Hi Daniel, the issue is now solved,
It was indeed the wrong interpreter. The one I normally use on wsl ubuntu (3.9) had nnfs installed, but the version linked to pycharm and vscode (3.10) did not have it installed.

Thanks for your help.

@daniel-kukiela
Copy link
Collaborator

I'm glad we solved that :)
Hope you'll enjoy the book or the videos (I'm not sure which one you;re following) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants