WillKoehrsen / Data-Analysis

Data Science Using Python

Home Page:https://medium.com/@williamkoehrsen/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ModuleNotFoundError

michaelstacy1111 opened this issue · comments

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

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!

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