Reputation: 1806
What is the closest thing I can get to a correct single-line syntax for launching a specific ipython with the latest anaconda version on Microsoft Windows?
Examples (that don't work):
C:\> ipython qtconsole --python=3
for the latest version of python 3.
C:\> ipython notebook --python=3.3.5
for the exact version of python 3.
C:\> ipython console --log-level=DEBUG --python=3.4
for the exact version of python 3.4 with verbose log
?
Upvotes: 1
Views: 1116
Reputation: 1806
The correct answer on a fresh anaconda install on windows is to use cmd.exe
and create a new environment:
C:\Anaconda>conda create -n py3k python=3 anaconda
Anaconda fetches, extracts and links the package(s), and provides the helpful message:
#
# To activate this environment, use:
# > activate py3k
#
To which the user should type:
C:\Anaconda>activate py3k
hereby cmd.exe
prints:
Activating environment "py3k"...
[py3k] C:\Anaconda>
To launch the python qtconsole based on the version declared in the line: C:\Anaconda>conda create -n py3k python=3 anaconda
the user should type:
[py3k] C:\Anaconda>ipython qtconsole
In case the user still sees python 2.7.6 it will be because s/he/it forgot to add anaconda at the end of the environment creation: C:\Anaconda>conda create -n py3k python=3 anaconda
If a full anaconda environment is not needed, the user may initiate the needed packages only by issuing the command:
C:\Anaconda>conda create -n [name] python=[version] python=[version] [list of packages separated by spaces]
Thanks to the iPython mailing list for these inputs.
Upvotes: 1
Reputation: 102039
As far as I know the ipython
command doesn't provide a way to choose the python version.
However you can use the standard python facility for launching modules:
pythonX.Y -m IPython <other options>
For example:
python3 -m IPython qtconsole
python3.3.5 -m IPython notebook
python3.4 -m IPython console --log-level=DEBUG
Instead of asking ipython
to choose an interpreter you specify the interpreter explicitly and tell it to run the IPython
installed for it.
Upvotes: 1