Update your pip&download jupyter lab
Problem 1
在安装jupyter notebook的末尾,python 好心提醒我:您的pip该更新了,有新版本可用:
WARNING: You are using pip version 20.2.4; however, version 20.3.1 is available.
You should consider upgrading via the 'f:\python38\python.exe -m pip install --upgrade pip' command.
于是,我使用了这个指令:pip install --upgrade pip
,接着就有了下面这句话:
C:\Users\Asus>pip install --upgrade pip
Collecting pip
Downloading pip-20.3.1-py2.py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 163 kB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.4
Uninstalling pip-20.2.4:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'f:\\python38\\scripts\\pip.exe'
Consider using the `--user` option or check the permissions.
然后我试了下pip,就告诉我:
ModuleNotFoundError: No module named 'pip'
因为上面uninstall了pip 之后立马就报错了,所以它并没有安装新版本的pip,所以目前状态是没有pip了… 装新的没弄成,反而还把旧的卸了…
Solution 1
几经折腾,如下顺序在我的电脑上可用:
1. python -m ensurepip
2. python -m pip install --upgrade pip
第一句指令会安装一个低版本pip,第二句指令就是更新pip了,所以以后更新pip就用第二个命令。
Problem 2
使用如下命令安装jupyter lab
pip install jupyter lab
使用如下命令启动jupyter lab
jupyter lab
报如下错误:
Jupyter command `jupyter-lab` not found
Solution 2
因为(链接)
Its the space. Its always the space.
Never ever use spaces within package name. Its always either namepart1-namepart2 or namepart1namepart2. This is because arguments are separated by space.
So if you put space in between, it makes pip think that you want to install two different packages named jupyter and lab.
Just use:
python -m pip install jupyterlab
原因就是你使用了空格,误装了jupyter 和 lab这两个包…
解决方法:
# 1. 如果之前误装了jupyter 和 lab,请执行以下命令,否则直接进入第二步:
pip uninstall jupyter lab #同时删除这两个包
# 2. Install
python -m pip install jupyterlab
# or
pip install jupyterlab
# 3. start
jupyter lab
# or
jupyter-lab