importing matplotlib in jupyter notebook - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: importing matplotlib in jupyter notebook (/thread-32669.html) |
importing matplotlib in jupyter notebook - Led_Zeppelin - Feb-24-2021 The following code produces the following error; import pandas as pd from matplotlib import pyplot as plt import math import re import numpy as np import feather from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.pipeline import Pipeline from sklearn.linear_model import SGDClassifier from xgboost import XGBClassifier from lightgbm import LGBMClassifier from datetime import date from dateutil.parser import isoparse from pandas.plotting import tableThe error is now shown: I am using matplotlib and matplotlib-base ver 3.3.3I am also using python 3.8.2. I do not know how to get rid of this error? Thanks in adavnce. Respectfully, LZ RE: importing matplotlib in jupyter notebook - jefsummers - Feb-24-2021 Are you certain that matplotlip is installed in that particular environment? RE: importing matplotlib in jupyter notebook - snippsat - Feb-25-2021 You most active environment,then it look like this. (py-dep) C:\Users\james\miniconda3\envs\py-dep\...Most always activate environment in Anaconda (base) or own made environment. Earlier version could get away not activate environment,but not anymore. Look at this post. RE: importing matplotlib in jupyter notebook - Led_Zeppelin - Feb-25-2021 I clicked on the miniconda command activate in my Windows 10 program list. From there I typed in Jupyter notebook and onece the IDE is up and running I switch to playcall virtual environment by the drop down menu in the upper right hand corner. From there I loaded the ipynb file and then hit run all. That is how I got the 1st. error. In the last hour I click on miniconda jupyter environment. It brings up a command line from the command line I activated the playcall virtual environment. I had previously downloaded a *.py of the playcall python code. Then I type python playcall.py This time it ran from the command line. It crashed on the import feather line. I thought, that I had taken care of that. I used the command: conda install feather-format -c conda-forge It seemed to work and I guess that I had not. I know that you just do not type conda install feather. Respectfully, LZ RE: importing matplotlib in jupyter notebook - snippsat - Feb-25-2021 (Feb-25-2021, 05:53 PM)Led_Zeppelin Wrote: I clicked on the miniconda command activate in my Windows 10 program listYou should probably not click on anything,most learn to to all from command line. Eg use Anaconda Prompt,i use cmder(as it's much better that cmd/powershell). When you have py-de in envs dos it means that this is virtual environment.Then most activate py-de to use it. miniconda3\envs\py-de\...Quick demo and i use Anaconda prompt for this demo,and new_env as i made it before in link posted.# See (base) environment is active (base) PS C:\Users\Tom> conda activate new_env # new_env is activated,for you py-de (new_env) PS C:\Users\Tom> # Test python (new_env) PS C:\Users\Tom> python -V Python 3.9.1 # Test pip see that it point to new_env folder. (new_env) PS C:\Users\Tom> pip -V pip 20.3.3 from C:\Anaconda3\envs\new_env\lib\site-packages\pip (python 3.9) # Test conda (new_env) PS C:\Users\Tom> conda -V conda 4.9.2 |