Questions about setting up a local development environment #11

Open
ehmatthes opened this Issue Sep 23, 2013 · 21 comments

Projects

None yet

4 participants

@ehmatthes
Owner

The readme is pretty sparse right now, so if you are trying to get involved and have any questions about setup, please feel free to ask them here.

@ehmatthes ehmatthes added a commit that referenced this issue Sep 23, 2013
@ehmatthes Added link to Issue #11. 43e22a9
@akkartik

I just followed the steps and ran the notebook. The index page looks good, but is this how it's supposed to look when I click on hello_world?

hello

@ehmatthes
Owner

Here's what I see:

hello_world

I think you are using an older version of IPython Notebook than I am. I started the project using the standard Ubuntu 12.04 versions of ipython and ipython-notebook. That worked for the code that runs the same under 2.7 and 3.3. When I did the section on floats, I needed to run 3.3 in IPython Notebook.

At that point I installed ipython3, and ipython3-notebook. For most development on this project now, I run ipython3 notebook, and only run 2.7 when I am writing up specific examples about 2.7.

I have updated the readme to show how I installed ipython3-notebook on Ubuntu 12.04. I think if you install ipython3-notebook, or the appropriate version of that for your system, you will see what I see.

When I updated my versions of ipython-notebook and ipython3-notebook and then opened the notebooks for the first time, I got a message that the notebooks would no longer be compatible with older versions of ipython notebook.

Hope that helps, and please let me know how it turns out.

@akkartik

Noooo, not python 3 again.. :(

@ehmatthes
Owner

Noooo, not python 3 again.. :(

Ha ha! I'm not sure if you're saying that from a teacher, student, or developer perspective, but I'd be curious to hear.

Student perspective

I focused on Python 3 because I am building these notebooks for teaching people brand new to programming. The thinking is, people who are just starting to program are going to spend more time in Python 3 than Python 2. They don't have any legacy projects they need to maintain, and they don't have any packages they are trying to use that depend on Python 2. Anyone who can code in Python 3 is going to learn Python 2 syntax quickly and easily if they take on a project that requires Python 2.

So, with students I have them learn Python 3 until they find themselves needing Python 2. I am finding it's good to bring myself up to speed with Python 3 as well.

Contributing to this project

I think someone could contribute to this project without ever touching Python 3, because most of the code is compatible with Python 2. The project code might be different, but at that point it might be good to make separate dedicated notebooks for each project in Python 2 and Python 3.

If anyone is staying away from this project just because of Python 3 issues, please let me know and we'll see if there's a straightforward way to address your concerns.

Thanks!

@ehmatthes
Owner

@akkartik, I think I just have a newer version of ipython notebook than you. I don't really think what you are seeing is a python 2/ python 3 issue.

@akkartik

I think the problem might be that your instructions are in terms of apt-get, but my distro doesn't support the versions you indicate. It would suck to have to upgrade the OS just to install a tool to learn programming. Perhaps you could show how to install the right ipython-notebook in a virtualenv?

(I'm trying to figure this out as well. I've been stumped a few times by versioning issues, but hopefully I'll sort it out this time.)

@ehmatthes
Owner

Thanks, I'll take a look at this shortly. What system/ distro are you on?

@akkartik

I'm on ubuntu (12.04 precise). Pretty vanilla otherwise.

@ehmatthes
Owner

All right, I just installed a fresh version of 12.04 in virtualbox, so I could test out the directions on a fresh install. These notebooks just require a later version of ipython and ipython notebook than the standard 12.04 packages. This should get you up and running:

$ sudo apt-get install ipython=0.13.2-1~ubuntu12.04.1
$ sudo apt-get install ipython-notebook=0.13.2-1~ubuntu12.04.1
$ git clone https://github.com/ehmatthes/intro_programming
$ cd intro_programming/notebooks
$ ipython notebook

You should not have to uninstall the current versions of ipython and ipython-notebook; this will update your versions of both packages. Can you let me know if that works? You shouldn't have to do anything with Python 3, except for one or two sections in the whole project.

@akkartik

It worked!! Many thanks, Eric, and sorry for being grouchy. I look forward
to playing more with this.

@ehmatthes
Owner

No matter, I've been meaning to get virtualbox set up for a while now. I'm happy to answer more questions, so please don't hesitate to ask.

@akkartik

I had no idea you could install later versions than the default with apt-get (no tinkering with ppas, etc.) Thanks for the insight.

Oh well, I guess I'll punt on installing the right versions inside a virtualenv. One of these days I'll figure out how to do that.

@ehmatthes
Owner

I got ipython notebook running in a virtualenv using Python 2.7:

$ git clone https://github.com/ehmatthes/intro_programming
$ cd intro_programming
$ virtualenv --distribute venv
$ source venv/bin/activate
$ pip install ipython[all]
$ cd notebooks
$ ipython notebook

This worked for me, and it was really interesting. This installs version 1.1.0 of ipython, which includes ipython-notebook. This is a newer version than what I have in the readme, and I like it better than the 0.13 release.

I did not get Python 3.3 running in the virtualenv.

I will look at updating the readme to use the 1.1.0 release of ipython. Thanks again for pushing this issue.

@bkamapantula
Contributor

Hi @ehmatthes! I ran iPython using the comments you made in #11 (comment). It ran fine. I shutdown the server and try to run again but iPython wouldn't run.

I re-ran the commands again and iPython runs fine. Should iPython execute always in the virtualenv?

@ehmatthes
Owner

I have just opened this project for the first time in several months. I activate my virtualenv before running ipython. So I think the answer is yes, but I'm not quite sure.

Do you want your ipython to be running python2.7 or python3?

Edit: I'm going to hit this project hard again in August/ September, the next time I teach a full Python class. One of my goals then is to update the project to IPython 2.x. I will do a full revision of the readme by then, if not earlier.

If anyone wants to work on introtopython and is having trouble getting a dev environment set up in the meantime, please don't hesitate to ask, and I will get on this sooner.

  • Eric
@bkamapantula
Contributor

I am planning to shift to python3 completely (most of my development is still in 2.7). Hence, ipython with python3.

I tried using iPython before but not with much success. Hoping to improve my ipython skills with this project.

@ehmatthes
Owner

IPython is pretty awesome, and it is under rapid development at this point. I'm happy to answer any questions you have, especially in regards to playing with this project.

I ran iPython using the comments you made in #11 (comment). It ran fine. I shutdown the server and try to run again but iPython wouldn't run.

I re-ran the commands again and iPython runs fine. Should iPython execute always in the virtualenv?

To be clear, yes I think you need an active virtualenv if you are taking the approach in #11. In this approach, IPython is installed into the virtualenv, and will only run when that virtualenv is active.

@bkamapantula
Contributor

Thank you. I shall read more about IPython and virtualenv.

@karthikraman

Amazing notebooks; thank you so much. I'll be using parts of this to teach a Data Structures course this semester...

@ehmatthes
Owner

@karthikraman Thanks, that's good to know! If you have any questions or suggestions as you're using the notebooks, feel free to let me know. I'll probably be doing some significant work on the project again this fall when I'm teaching my next Python class. If there's anything you need before then, let me know.

What kind of students are you working with?

@karthikraman

I am working with students who don't have a background in Python, but have been exposed briefly to C. The class itself is "Data Structures and Algorithms for Biology", but Python is the language of choice. I teach Python for about 5-6 classes, before introducing data structures, algos and how they're applied in biology. My class is a mix of students, mostly majoring in Biological engineering, but a few others as well (Chemical etc.). Your notes are brilliant. I am making a much more concise notebook, and pointing to your notes in many sections, for more details!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment