0

I am trying to install 2 python packages on Anaconda Jupyter Notebook. The links to the python packages are as follow: 1) https://iapws.readthedocs.io/en/latest/modules.html 2) https://pythonhosted.org/thermopy/iapws.html#module-thermopy.iapws

But I am getting the following error on both installations. Can anyone tell me what is wrong?

Error Screenshot

Ombre
  • 103
  • 1
  • 3
  • 10
  • Possible duplicate of [Installing a pip package from within a Jupyter Notebook not working](https://stackoverflow.com/questions/38368318/installing-a-pip-package-from-within-a-jupyter-notebook-not-working) – Psychotechnopath Feb 21 '19 at 08:03
  • That being said, check out [This Link](https://stackoverflow.com/questions/38368318/installing-a-pip-package-from-within-a-jupyter-notebook-not-working) – Psychotechnopath Feb 21 '19 at 08:04
  • Well, it's telling you `connection timed out`. Are you sure your Jupyter server has access to internet? Can you install *any* other package using `pip`? – darksky Feb 21 '19 at 08:04
  • If you type `! ping google.com` what do you get? – darksky Feb 21 '19 at 08:06
  • !ping google.com gets me Request Timed Out. – Ombre Feb 21 '19 at 08:50
  • I have no issues using my internet. So I am assuming my Jupyter notebook can access the internet too. – Ombre Feb 21 '19 at 08:53
  • Well, it seems it cannot. How did you start the jupyter notebook service? Did you just type in terminal `jupyter notebook` from your regular, non-root user? Or have you done anything else? If you open up a terminal, can you ping google? Do you have a firewall installed on your operating system? It looks like its a Mac, so maybe you have to go to Mac settings and allow access to internet to jupyter somehow. – darksky Feb 21 '19 at 08:57
  • I am using a Windows laptop (company's). I started jupyter notebook service by first launching Anaconda program. Let me try doing the same on my personal computer later and see if I get the same problems. – Ombre Feb 21 '19 at 09:09

2 Answers2

2

Through Anaconda you should write this on your Jupyter notebook :

# Install a conda package in the current Jupyter kernel
import sys
!conda install --yes --prefix {sys.prefix} packagename

With a normal install of python you should write this on your Jupyter notebook :

# Install a pip package in the current Jupyter kernel
import sys
!{sys.executable} -m pip install packagename

By replacing packagename with the name of your package like numpy.

Cheers

Rob128
  • 21
  • 4
0

Your Jupyter notebook server does not have access to internet. You operating system might have a firewall or limit internet access to third party applications, especially since this is a work laptop.

Regardless, it is easy to install components using pip. If you cannot access the internet from inside the notebook, try opening a Command Prompt as admin and simply type pip install iapws.

darksky
  • 1,955
  • 16
  • 28
  • I have done the same steps on my personal computer and the installation is successful. Thanks for your guidance on troubleshooting. – Ombre Feb 22 '19 at 00:56