Medical Data Visualizer

Hi,
I would like to start to solve the project, but I don’t know how to deal with this traceback:
 python main.py
Traceback (most recent call last):
File “main.py”, line 2, in
import medical_data_visualizer
File “/home/runner/boilerplate-medical-data-visualizer-1/medical_data_visualizer.py”, line 1, in
import pandas as pd
ModuleNotFoundError: No module named ‘pandas’
exit status 1

This is third project and I have no problem in the two previous ones…
thank you

I haven’t used Python but based on the stack trace, you’re missing ‘pandas’
You can tell by looking at the path /home/runner/boilerplate-medical-data-visualizer-1/medical_data_visualizer.py to the file where line 1 is throwing the error of module not found: line 1, in import pandas as pd ← problem is on line 1

This thread touches on the same issue someone else had - you might be dealing with a permissions problem as well:

python 3.x - import pandas as pd ImportError: No module named pandas - Stack Overflow

I think, it will be something else, because when I shuffled the rows from
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np

to e.g.
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

always is problem with the first row (import)…

 python main.py
Traceback (most recent call last):
File “main.py”, line 2, in
import medical_data_visualizer
File “/home/runner/boilerplate-medical-data-visualizer-1/medical_data_visualizer.py”, line 1, in
import seaborn as sns
ModuleNotFoundError: No module named ‘seaborn’

Did you try this?
Go to file > settings > project interpreter and see if pandas is available in the list of packages.

Check and see if the modules that are throwing errors are actually installed. If they are then you have a permissions issue.
If not then you’ll need to figure out why they weren’t installed - perhaps still permissions based - and move from there.

I got the same issue before.
Just deleted the current project and opened new one by importing from github.
Then I installed on console by;
pip install pandas
pip install seaborn

It did it successfuly

it doesn’t work
 python main.py
Traceback (most recent call last):
File “main.py”, line 2, in
import medical_data_visualizer
File “/home/runner/boilerplate-medical-data-visualizer-2/medical_data_visualizer.py”, line 1
pip install pandas
^
SyntaxError: invalid syntax
exit status 1

There are a bunch of threads on these errors in the forums, with solutions. This one is the most general I believe.

Hi, thank you for your advice, I’m really beginner and I don’t understand what exactly to do… I normally use Jupyter and everything works well… but I would like to finish the challenges and obtain the certificate

You’ll have to provide some more information. The steps are fairly straightforward, so which did you try or with which did you have problems? What were the specific steps you took and what were the errors if any that were produced (aside from the original ModuleNotFoundError)?

If you’re still having problems, you may need to post a link to your repl since I don’t see one posted yet.

Hi, I fixed the issue… I followed the instructions and also updated Anaconda, that helped… I finished the challenge.
I’m fighting now with another issue
AttributeError: Rectangle.set() got an unexpected keyword argument ‘ylabel’

the code:
def draw_bar_plot():
# Copy and modify data for monthly bar plot
df[‘month’] = df.index.month
df[‘year’] = df.index.year
df_bar = df.groupby([‘year’, ‘month’])[‘value’].mean()
df_bar = df_bar.unstack()
# Draw bar plot
fig = df_bar.plot.bar(legend=True, figsize=(13,6), ylabel=“Average Page Views”, xlabel=“Years”).figure
plt.legend([‘January’, ‘February’, ‘March’, ‘April’, ‘May’, ‘June’, ‘July’, ‘August’, ‘September’, ‘October’, ‘November’, ‘December’])
plt.xticks(fontsize = 10)
plt.yticks(fontsize = 10)

link: boilerplate-page-view-time-series-visualizer (1) - Python Repl - Replit

thank you for your help in advance

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.