Newbie installation problem: No module named IPython

Apr 19, 2013 at 11:14 AM
I installed ActivePython 3.2.2.3 win-32 on Windows 7 with VS2010 and PTVS 2.0 Alpha VS 2010.msi. I have the standard REPL running, but after I configured it for IPython, I'm getting:

"IPython mode requires IPython 0.11 or later: No module named IPython".

Do I need to install anything else? I was following Pytools tutorial and I thought it was included in ActivePython distribution. I have practically zero experience with Python, so I'm not sure were to search for IPython other than Python32 directory, which doesn't have it.
Coordinator
Apr 19, 2013 at 4:58 PM
It looks like ActivePython does not include IPython, so you'll have to get it separately.

The easiest way to get IPython is from http://www.lfd.uci.edu/~gohlke/pythonlibs/. You will want ipython-0.13.2.win32-py3.2.‌exe, pyreadline-2.0.win32-py3.2.‌exe and pyzmq-13.0.2.win32-py3.2.‌exe, and then you should be good to go.

(And as a side note, we're currently working on new 'getting started' pages/videos, so we'll make sure that IPython installation gets on there.)
Apr 19, 2013 at 8:20 PM
Thanks a lot, it works now. It was complaining about missing matplot so I added matplotlib-1.2.1.win32-py3.2.exe to the list. Unfortunately, plotting doesn't work, but it is not a show stopper for me at the moment.

I'm going to make another installation, this time on 64-bit system. I started with ActivePython again, but they don't provide a free version of NumPy for 64-bit distribution. EPD has the same issue with 64-bit distribution. So I'm planning to uninstall ActivePython and get CPython (python-3.3.1.amd64.msi), Scipy-stack-13.4.9.win-amd64-py3.3.‌exe and PTVS 1.5 VS 2012.msi. Do you see any problem with this?

It is going to my production system, so I want to play it safe, but if PTVS 2.0 Alpha VS 2012.msi is safe to uninstall, upgrade or downgrade, I can try it instead of v.1.5.
Coordinator
Apr 19, 2013 at 9:04 PM
You won't be able to downgrade directly from 2.0 Alpha to 1.5, but you can certainly uninstall it first.

If you feel up to mixing and matching your own packages, then you may want to skip the ActivePython distribution. It's also worth investing in pip and distribute, which are the standard package managers for Python - these will give you the "pip install ..." and "easy_install ..." commands you may have seen.
Apr 19, 2013 at 11:01 PM
Edited Apr 19, 2013 at 11:27 PM
I tried a CPython + packages, but it has some issues with administrator privileges on Windows 7. How about Anaconda distribution, will it work with PTVS? I like their business model - they charge only for their own custom packages, so I can get 64-bit Python free.

EDIT:

Oooops, their free 64-bit distribution has Python 2.7, but I need 3.3. I will try something else.
Coordinator
Apr 19, 2013 at 11:25 PM
I haven't used Anaconda myself, so I can't comment. The only issue would be if they install Python in a way that we don't detect - there is an Add Interpreter option where you can fill in paths manually (under Tools->Options->Python Tools->Interpreter Options) if this happens. Let us know how it goes :)

For vanilla CPython, the only privilege related issues should be that you need to elevate for installing packages. It's a slight pain but it is the nature of installing software. easy_install (part of distribute) generally handles this quite well.
Apr 19, 2013 at 11:52 PM
Edited Apr 20, 2013 at 12:36 AM
It seems that I was wrong about Anaconda: Python 2.7 is a default, which can be changed by setting configuration parameters. I have 3.3 IDLE working, but no menu items or IPython yet.

My issue was the absence of usual dialog box asking for permissions - installation completes with error message instead, without installing menu items. Error message asks to redo installation as administrator.
Coordinator
Apr 20, 2013 at 12:09 AM
In that case your best bet is to start the command prompt elevated. If you hold Shift and right-click on the Start Menu item then you should see a "Run as Administrator" option.

You are unlikely to see any new menu items from a Python package, but you should be able to do "import <package name>" afterwards. If you start having multiple versions of CPython installed then things can get complicated quite quickly - just a warning (we already support it in PTVS, and we're planning some features for our next release to help here).
Apr 20, 2013 at 1:57 AM
I got stuck with Anaconda - I don't know how to get 3.3 tools on program menu. They are using Advertised Shortcuts, which I don't want to mess with.

So I'm back to step by step path. I installed distribute with distribute_setup.py and on both 32-bit and 64-bit systems I'm getting this syntax error when running easy_install pip:
except ValueError, e: 
                 ^
SyntaxError: invalid syntax
Any clues what's going on?
Apr 20, 2013 at 5:34 AM
Another setback, I hope you don't mind this report, maybe it will be of some use to someone. I started from scratch, well almost from scratch, because PTVS 2.0 Alpha stays installed as I install/remove various Python distributions. So on 32-bit Windows 7 I did:
  1. Install Python 3.x (.msi) from http://python.org/.
  2. Install Distribute (.exe as administrator) from http://www.lfd.uci.edu/~gohlke/pythonlibs/.
  3. Install Pip (.exe as administrator) from http://www.lfd.uci.edu/~gohlke/pythonlibs/.
  4. Install IPython (.exe as administrator) from http://www.lfd.uci.edu/~gohlke/pythonlibs/.
  5. Install additional packages with pip install packageName (pyreadline, pyzmq)
So far so good, I can run slightly crippled IPython session in VS2010. Next I tried to add missing packages to get full IPython goodness and got stuck there with too many dependencies missing...
Apr 20, 2013 at 5:50 AM
Edited Apr 20, 2013 at 7:06 AM
Now for something a little bit better - 32-bit Windows 7:
Install Python 3.x (.msi) from http://python.org/.
Install Scipy-stack (.exe as administrator) from http://www.lfd.uci.edu/~gohlke/pythonlibs/.
Install PySide (.exe as administrator) from http://www.lfd.uci.edu/~gohlke/pythonlibs/.

Everything seems to be working so far (I mean: 2**8=256 and I can plot simple functions). Next is my 64-bit system.

EDIT

I repeated the sequence above with 64-bit files and PTVS 2.0 Alpha VS 2012. I tried "hello world" program and the basic functionality is working. Now it's time to learn Python.

I'm somewhat disappointed by this painful installation experience. Granted, I had specific requirements: 64-bit Python 3 on Windows, but this shouldn't be so tedious.
Coordinator
Apr 21, 2013 at 7:54 PM
sorry about your troubles paul. we'll take a close look at installation for 2.0 Beta and see how we can improve things. thanks for taking the time to report. the issue is compounded by the fact that there are literally 100s of combinations of installation options and it's difficult to test them all. our matrix includes:

Python: CPython 2.6, 2.7, 3.3 32bit and 64bit X IronPython 2.7
VS: VS pro 2010, VS pro 2012, VS shell 2010, VS 2012
Distro: Enthought, ActiveState, 32 & 64bit
non-distro: Various individual pkgs, 32 & 64bit
Win: Windows 7, Windows 8
SDK: Linux, Mac, Windows
Features: Edit, Intellisense, debug, profile, Azure, IPython, project, MPI, ...

multiply (almost) all of the above together for a massive test matrix.

we have some ideas on doing "scenario" based installs via WebPI, for example: "Learn Python", "Web Programming" or "Scientific Programming", where we grab everything you need for that scenario & install it all. this way you get a complete installation of packages that we know work well together. stay tuned.
Apr 22, 2013 at 5:39 AM
No problem. Your tools behaved well and survived multiple install/remove cycles of various Python distributions. For scientific programming, which was my goal, taking binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/ worked well. Thank you for your help.
Jul 31, 2013 at 8:52 PM
Edited Jul 31, 2013 at 10:29 PM
I was able to get Python Tools for Visual Studio and one of Anaconda's environments to work together. Here's my write up on it.
Coordinator
Jul 31, 2013 at 9:44 PM
The blog URL seems to be an edit link that's relative to your LogDown account, and so is inaccessible to anyone else - can you share the public URL for it?
Jul 31, 2013 at 10:30 PM
Sorry, I thought I had entered in the correct URL. It should work now.