WillKoehrsen / Data-Analysis

Data Science Using Python
https://medium.com/@williamkoehrsen/
MIT License
5.18k stars 3.64k forks source link

ModuleNotFoundError #48

Open michaelstacy1111 opened 5 years ago

michaelstacy1111 commented 5 years ago

ModuleNotFoundError Traceback (most recent call last)

in () ----> 1 from stocker import Stocker ModuleNotFoundError: No module named 'stocker' --------------------------------------------------------------------------- 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. Link to cell: https://colab.research.google.com/drive/1NBS2wwQmApALKCQrv86Wye4-QwpExq9S#scrollTo=KFpvknWXRRQ6
hransom528 commented 5 years ago

This happened to me as well.

First, make sure you have installed all the packages. Try using pip3 instead, try sudo, try both.

Next, create a Jupyter notebook or .py script in the same directory as the stocker.py file. You must must must have the stocker.py file in the same exact directory as the code!!!!

Hope this helps. Happy coding!

swaggerificc commented 4 years ago

Hello! I'm having a similar issue. I'm running spyder (python 3.7) Anaconda I've installed all the packages and the mycode.py file is in the same directory as the stocker.py file.

INPUT: from stocker import stocker

microsoft = stocker(ticker='MSFT') techm = stocker(ticker='TECHM', exchange='NSE')

RESULT: runfile('C:/Users/Joshua/Anaconda3/Lib/site-packages/stocker/stock_prediction.py', wdir='C:/Users/Joshua/Anaconda3/Lib/site-packages/stocker') Traceback (most recent call last):

File "C:\Users\Joshua\Anaconda3\Lib\site-packages\stocker\stock_prediction.py", line 16, in microsoft = stocker(ticker='MSFT')

TypeError: 'module' object is not callable