I am using iPython on OSX (on system, not inside a virtualenv) and importing pandas into a notebook. My system python is Python 2.
The version of pandas visible in the notebook is 0.16.2:
import pandas as pd
print pd.__version__
I want to use pandas 0.18. So I have quit the notebook and run:
pip install --upgrade ipython
pip install --upgrade pandas
This appeared to install ipython 4.1.2 and pandas 0.18.0, but if I run:
ipython --version
I see v4.0. And running my notebook still shows pandas 0.16.2.
How do I upgrade my packages so that I can use pandas 0.18 inside my notebook?
Update a package: pip install --upgrade To update installed packages to the latest version, run pip install with the --upgrade or -U option.
Updating Pip b is available.” You can run “pip install --upgrade pip” to install and use the new version of pip. To update pip2 or pip3 using this command, only replace the first pip with the pip version.
pip is Python's official package manager and is a recommended method for installing, upgrading, and uninstalling the Python packages.
Using the following command you can update ipython, Open cmd and type the command:
pip install ipython --upgrade
The ipython
command invokes the respective python script, which is typically stored at /usr/local/bin/ipython
. The first line of this script denotes the python version to be used. In my case it is #!/usr/bin/python3.6
which means that ipython is using version 3.6 of python. Use the command which ipython | xargs head -n 1
to read this first line of your ipython script.
Once you know which python version ipython is using you can invoke the upgrade command. In my case, I have to execute pip3.6 install --upgrade ipython
and pip3.6 install --upgrade pandas
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With