Installing IPython

The following lesson asks the reader to install IPython and then type in sample text, but there is no link provided for the IPython install. Additionally at ipython.org there are only references to Jupyter Notebook and its related applications.
https://www.codecademy.com/paths/data-science/tracks/dscp-python-fundamentals/modules/dscp-getting-started-off-platform/articles/introducing-jupyter-notebook

After some searching I did find the following:

The lesson should be updated for easy-to-follow installation instructions. Thank you.

8 Likes

Thank you. You are a life-saver.

@novich0k,

Thanks for bringing this up!

After reading through the article, I can definitely see why you were confused about this.

IPython is actually included when you install Jupyter and it’s primarily used in Jupyter notebooks because that’s a nicer interface than in the terminal. However, once Jupyter is installed you can always use IPython in the terminal if you wish to do so.

Happy coding!

P.s., if you end up using IPython in the terminal, you can always get back to your regular command line by typing exit and then hitting Enter.

4 Likes

Thank you for posting this, I’ve been driving myself mad trying to figure this out myself!

I’d like to add another question to the thread as I’m also having difficulties. I’ve downloaded Python and am trying to install Jupyter Labs. The instructions say to install using PIP but I don’t seem to have the ability to do so. I’ve tried using Python 3.8 and 3.9, which should have PIP included according to the documentation, but following guides to verify PIP installation tells me that I don’t have PIP installed for some reason as nothing I’ve tried has been able to verify that it exists on my machine.

Has anyone else run into this issue? Does anyone have resources that they could link that might help me? I’m completely new to coding and most of what I’ve found has been far over my head, geared toward users who are coming from other languages and are already familiar with terminology and how things work.

@jjman291, pip has been included with Python since version 3.4, so if you are using Python 3.8 or 3.9 you should definitely have it. Can you please provide a link to the article that has you confused?

Also, how did you download your Python versions? From python.org, or through Anaconda/Miniconda?

1 Like

The instructions in this article are the ones that I’ve tried so far:

I’ve tried the steps for checking if pip is installed and verifying my python installation. The python installation verification did not function. Instead of displaying the verification message it opened the Windows store to the Python 3.8 page. I can call python with “py” in windows cmd prompt and it will display the verification message properly.

When trying the first step to check if pip is already installed I’m met with the following error message:

Not going to lie, I feel like I somehow got skipped forward over a few critical lessons or that I’ve somehow missed something in the previous lessons. The previous lessons that I’ve been doing have been easily understood and the knowledge builds upon itself well. I reviewed the previous lessons to see if I’d missed anything but I’m at a loss on where I could’ve done so.

Alright, it looks like you are using Python 3.9. In that case, pip is already installed.

The reason you are not seeing anything when you type pip help is that you are not typing pip help in the command prompt, you are typing it in to the interactive Python REPL.

Now, did you ever actually install Python yourself?

1 Like

I wondered if that was possibly the issue. When using the windows command prompt I receive the following error message:

I’m confused about your question. To the best of my knowledge, yes, I have installed python. I’ve downloaded and installed v3.9 several times and also tried v3.8 when I saw that it was what was supported on the windows store. The downloads I have installed have come from Python.org:

and I have downloaded the Windows x86-64 executable installer

Perhaps I’m not understanding what you mean when you ask if I have installed Python myself.

1 Like

Okay, I was just double checking because you hadn’t answered my earlier question about where you downloaded it from. Sometimes Python comes pre-installed with the operating system and I wanted to make sure you weren’t using that Python.

Now, it seems the likely problem is that the script to run pip is not in your PATH. When you are installing Python on Windows, I believe there is usually a checkbox during one of the steps that allows the installer to add Python to the path automatically.

If you don’t do that, you will have to add the location of Python and its scripts to your PATH yourself.

To do that, type “environment” in the Windows search bar and select “Edit the system environment variables”:

Then click on the “Environment Variables…” button at the bottom of the window:

The new window will contain sections for user variables and system variables.
In the User Variables section, scroll down until you see one called “Path”. Double-click on that.

A window called “Edit environment variable” will pop up. Click the “New” button and add the path to your Python version, then add the path to its scripts.

It should look something like this:

The top path is to the Scripts folder that holds the pip executable, and the bottom path is to the Python{version_number} folder that holds the Python executable.

If you don’t know where your version of Python is installed, type the command where python into CMD. For Python 3.9 it is usually located at:

  • C:\Users\{your_user_name}\AppData\Local\Programs\Python\Python39-32 or at
  • C:\Python39

Once the paths to the Python folder and the Scripts folder are added, just hit Ok and you are done. You will have to restart the command prompt before it will recognize this change though.

Let me know if this helps!

1 Like

Apologies for the late reply as I was traveling.

The issue was just as you described. Once I checked the box to add PATH the problem was solved.

Thank you for your help!

1 Like

At this point in the career path we have not installed Jupiter yet. The best place to add more instructions would be the chapter “command-line interface setup”. (It currently instructs mac users to not install anything and just use the Terminal, meaning we won’t have IPython installed).

Absolutely legend, thanks for posting this. The page is definitely out of date and doesn’t really explain much

Thank you for this! I was also confused. It seems like this section on IPython should come after they tell us how to install Python or Miniconda and the Jupyter notebooks. After reading this I went ahead and installed Miniconda and Jupyter Notebook and then I was able to go back and try out the instructions that let you play around with the sample text in IPython.

1 Like

Hello-
I was able to download Jupyter Notebook, but am still having difficulties with accessing IPython via Conda in Git Bash. I did try installing IPython prior to installing Jupyter Notebook and it looked as though IPython was installed by conda (conda install ipython); however, when I execute ipython in Git Bash I get the following error: ImportError: No Module named functools_lru_cache. Please see screenshot below.

Any suggestion on overcoming this issue is appreciated.
Thanks

Is there a good reason you’re using minconda2? Ideally you’d be working with miniconda3 and Python3 as Python2 is no longer actively maintained. Unless you’re forced to do so, e.g. with a very dated OS or a strong need for a package that isn’t supported at all in Python3 then I’d highly suggest uninstalling miniconda2 and using miniconda3 instead.

I just tried getting IPython with pip (not conda but the differences shouldn’t be too big for a single package) on a Python2 distribution and it required at least two packages under backports namely backports.functools-lru-cache-1.6.1 and backports.shutil-get-terminal-size-1.0.0.

It seems that it may throw errors if these aren’t also installed. You could try adding backports.functools-lru-cache with conda but I think your first step is making sure that you actually want to be using Python2.

1 Like

Following the link from ’ Introducing Jupyter Notebook’ and the discussion in this thread, it appears I need to download Jupyter. Jupyter.org describes an instalation process. However, I dont know what PIP, conda or Voila are. Does anyone have additional information about how to download Jupyter and get back on track with the Data Scientist path?

If you’re already at the Jupyter site the install page should have multiple links describing how to install it. It might help if you look up the documentation for each of these tools and decide what’s appropriate, there’s more info than a simple reply can cover.

If you want the shortest route to get back on data science path then installing Anaconda might be easiest (it’ll include both Python and Jupyter in the basic install along with several others things you’ll likely use later on the path). If you want to spend a bit of time getting to know these tools then that’s also reasonable. CC should have guidance on them somewhere (or a general web search would help) and you can find the docs below-

Edit: I’ve not used voila but I don’t think you need it at this point. You’d need a Python distribution before getting started and it seems to based around sharing simplified Jupyter projects as their own web application majigs (interesting but probably not useful to you at this point).

2 Likes

I felt stuck. This was helpful. Thank you!

1 Like

Hi tgrtim-
Thanks for the response. The directions I found suggested that I upload (I believe) v 2.7 rather than the latest 3 version. But I also read that Python 2 versions would no longer be supported and only Python 3 versions. I will go ahead and uninstall the version I have and install the latest versions.
Thanks again!

1 Like

Hi trgtim-

So I removed Minconda2 and through Git Bash worked to install Anaconda3.8. In Git Bash when I typed in “activate conda” it seemed to work, but now I keep getting the following error message when I open a new Git Bash Window:

bash: /c/Users/sthompson/Miniconda2/etc/profile.d/conda.sh: No such file or directory
bash: /c/Users/sthompson/.bashrc: line 5: unexpected EOF while looking for matching `’’
bash: /c/Users/sthompson/.bashrc: line 7: syntax error: unexpected end of file
(base)
SThompson@FDDH1Z2 MINGW64 /
$

Any ideas how I can remove the error messages above (base)?
Thanks,
Scot