[英]How can I install ipython notebook on ubuntu 17?
I tried to install ipython notebook on my OS.But there was an error.How can I solve this? 我试着在我的操作系统上安装ipython笔记本。但是有一个错误。我怎么能解决这个问题?
sudo apt-get install ipython-notebook
Reading package lists... Done 阅读包裹清单......完成
Building dependency tree 构建依赖树
Reading state information... Done 阅读国家信息......完成
Package ipython-notebook is not available, but is referred to by another packag. 包ipython-notebook不可用,但是由另一个packag引用。 This may mean that the package is missing, has been obsoleted, or is only available from another source
这可能意味着包丢失,已被淘汰或仅可从其他来源获得
E: Package 'ipython-notebook' has no installation candidate E:包'ipython-notebook'没有安装候选者
Do you already have python installed? 你已经安装了python吗? If so, try:
如果是这样,请尝试:
sudo apt-get install ipython
or if you have pip: 或者如果你有点子:
pip install ipython ipython-notebook
Regardless, I instead recommend installing Anaconda or Miniconda from: 无论如何,我建议从以下位置安装Anaconda或Miniconda:
https://www.continuum.io/downloads https://www.continuum.io/downloads
This will help you setup virtual environments and packages. 这将帮助您设置虚拟环境和包。
I installed ipython
via apt
, and then went the pip
and virtualenvwrapper
route for ipython-notebook
, which worked for me. 我通过
apt
安装了ipython
,然后去了ipython-notebook
的pip
和virtualenvwrapper
路由,这对我ipython-notebook
。 The commands were: 命令是:
sudo apt -y install ipython mkvirtualenv ipynb pip install ipython[notebook]
Alternatively: 或者:
sudo apt -y install ipython mkvirtualenv ipynb pip install ipython[all]
As virtually every Linux distro, Ubuntu comes with Python 2.7 pre-installed. 几乎每个Linux发行版,Ubuntu都预装了Python 2.7。 In order to execute your Python code, you open your terminal, cd to the directory where the script is and run
python script.py
要执行Python代码,请打开终端,cd到脚本所在的目录并运行
python script.py
FWIW, I ran into this error when trying to run the following command on a freshly spun up Ubuntu 18 image (on AWS, ami-0ac019f4fcb7cb7e6): FWIW,我试图在刚刚运行的Ubuntu 18映像上运行以下命令时遇到此错误(在AWS上,ami-0ac019f4fcb7cb7e6):
sudo apt-get install ipython3
E: Package 'ipython3' has no installation candidate
E:包'ipython3'没有安装候选者
Running an apt-get update solved the problem. 运行apt-get更新解决了这个问题。 So:
所以:
sudo apt-get update
sudo apt-get install ipython3
Interestingly, I was surprised to find that this particular distro doesn't come with Python 2.7 installed, only Python3. 有趣的是,我惊讶地发现这个特殊的发行版没有安装Python 2.7,只有Python3。 That's probably AWS just trying to keep things light, which I appreciate.
这可能是AWS只是试图让事情变得轻松,我很欣赏。
Hopefully this helps someone down the line. 希望这可以帮助有人下线。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.