Install python packages on Jupyter Notebook

一个人想着一个人 提交于 2020-06-29 06:04:30

问题


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?


回答1:


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.




回答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



来源:https://stackoverflow.com/questions/54801963/install-python-packages-on-jupyter-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!