gpt4 book ai didi

python - 在 Ubuntu 14.04 中使用 pip 安装 Jupyter Notebook

转载 作者:行者123 更新时间:2023-12-04 19:01:15 25 4
gpt4 key购买 nike

我正在尝试安装 jupyter notebook但由于某些原因,我无法安装它。我查看了几个链接,例如 thisthis但这对我没有帮助。我猜这里的问题在于安装 pip .当我查看 pip 的版本时我得到以下结果:

 shaloin@shaolin-Inspiron-3543:~$ pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)

但是当我尝试升级 pip的版本时,我收到此错误:
shaloin@shaolin-Inspiron-3543:~$ sudo pip install --upgrade pip
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pip in /usr/lib/python2.7/dist-packages
Downloading/unpacking pip
Cleaning up...
No distributions at all found for pip in /usr/lib/python2.7/dist-packages
Storing debug log for failure in /home/shaloin/.pip/pip.log

所以,我搜索了错误,我知道如果你在代理后面,你应该尝试以下命令:
sudo pip --proxy [NITS:abcde@]172.16.30.20:8080 install jupyter

在哪里 NITS是用户名 abcde是密码, proxy server = 172.16.30.20password=8080 ,之后我收到以下错误:
Downloading/unpacking jupyter
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1178, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 194, in find_requirement
page = self._get_page(main_index_url, req)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_page
session=self.session,
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 670, in get_page
resp = session.get(url, headers={"Accept": "text/html"})
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 467, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 237, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 455, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 558, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/adapters.py", line 305, in send
conn = self.get_connection(request.url, proxies)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/adapters.py", line 206, in get_connection
except_on_missing_scheme(proxy)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/utils.py", line 636, in except_on_missing_scheme
raise MissingSchema('Proxy URLs must have explicit schemes.')
MissingSchema: Proxy URLs must have explicit schemes.

Storing debug log for failure in /home/shaloin/.pip/pip.log

我也尝试以这种方式设置我的代理:
set http_proxy=http://username:password@proxyAddress:port

set https_proxy=https://username:password@proxyAddress:port

但这些都不适用于安装 jupyter notebook使用 pip .

请不要将此问题标记为重复,因为我一直在寻找解决方案,但没有一个有效。

有人可以帮忙吗??

最佳答案

对于 Ubuntu 14.04

我使用 anaconda 解决了安装问题.描述在 this链接。我无法解决升级问题pip .安装步骤jupyter notebook下面给出:

第一步 (引用 here )

首先我们安装anaconda使用 wget

  • 32 位版本

  • wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda-2.3.0-Linux-x86.sh


  • 64 位版本

  • wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda-2.3.0-Linux-x86_64.sh



    第二步

    下载结束后:
  • 32 位版本

    bash Anaconda-2.3.0-Linux-x86.sh
  • 64 位版本

    bash Anaconda-2.3.0-Linux-x86_64.sh

  • 下载后 anaconda ,打开您的 terminal并输入以下命令:
    $ sudo gedit ~/.profile

    在文件末尾添加给定的行:
    export PATH=~/anaconda2/bin:$PATH

    第三步

    添加行后保存文件。开新 terminal并转到 anaconda 所在的目录已下载。
    $ cd anaconda2/bin
    ~/anaconda2/bin$ source activate
    (root):~/anaconda2/bin$ jupyter notebook
    jupyter notebook将在浏览器中打开。

    有关 jupyter notebook 的更多信息你可以引用这个 link .

    关于python - 在 Ubuntu 14.04 中使用 pip 安装 Jupyter Notebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47373827/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com