Python

Ed Basquill
Ed Basquill
3,984 Points

Over my head on set-up and modules in python....Treehouse is great but I'm not...

I am very focused and studying at tree house to make this one snippet of downloaded code work for a personal project of mine. Craig is great and I am doing well at beginning python, but I hit the wall when I try to run this code. It calls alot of modules and I suspect there are problems like version compatibility, set up, installation of modules and multiple experiential things that treehouse does a great job shielding beginners from with the workspaces and so on. Would it be appropriate to paste in the code and ask you folks to troubleshoot? Its probably me and my set up and not the code so I hesitate, Feels like I am asking you to do my job for me. Is there a class offering for python focused on setting it all up to work like the workspace? I will go back to the teacher notes on the earliest classes I guess. I am trying to get redvox audio files from redvox.io to output into a csv or format I can manipulate and analyze. The code snippet is from their website. I am looking at infrasound for a personal project I am a PE

Ed Basquill
Ed Basquill
3,984 Points

Latest error--- the program I downloaded has a line of code: import reader

The error says it can't find that module.

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 
 RESTART: C:\Users\HP\AppData\Local\Programs\Python\Python37-32\File7292018.py 
Traceback (most recent call last):
  File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\File7292018.py", line 12, in <module>
    import reader
ModuleNotFoundError: No module named 'reader'
>>>

MOD: I just formatted the console output so it's a bit easier to read (see Markdown Cheatsheet link below text boxes for how to do this - it's pretty easy!). :-)

1 Answer

Frank Genova
Frank Genova
Python Web Development Techdegree Student 12,586 Points

Here is how I approach this kind of problem:

  1. Copy the error message: ModuleNotFoundError: No module named 'reader'
  2. Paste it into Google and look for hits on sites like StackOverflow
  3. I found a hit that looks like a good lead with the answer showing a green checkmark and more votes.

From StackOverflow:

Tried installing tensorflow for python3, but the same issue.

So I just put this reader.py file in my main folder: http://programtalk.com/vs2/?source=python/7331/tensorflow_with_latest_papers/reader.py and that seems to work.

My suggestions:

  • You could try the StackOverflow solution or keep looking on StackOverflow for other suggestions
  • You could focus on installing the missing module using pip or conda
  • You could see if there is an issue with where reader.py is located
  • If you are using virtual environments make sure you are in the right environment and have all the needed modules in that environment