Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I upgrade packages used by iPython?

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?

like image 389
Richard Avatar asked Mar 25 '16 10:03

Richard


People also ask

How do you update an existing python package?

Update a package: pip install --upgrade To update installed packages to the latest version, run pip install with the --upgrade or -U option.

What is the command to upgrade pip?

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.

Can I use pip to upgrade Python?

pip is Python's official package manager and is a recommended method for installing, upgrading, and uninstalling the Python packages.


2 Answers

Using the following command you can update ipython, Open cmd and type the command:

pip install ipython --upgrade
like image 167
Farshad Javid Avatar answered Oct 27 '22 04:10

Farshad Javid


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.

like image 36
jboockmann Avatar answered Oct 27 '22 06:10

jboockmann