欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

pip install jupyter [Errno 2] No such file or directory

程序员文章站 2022-05-29 09:39:50
...

表现

在安装jupyter时,报错文件没找到:

➜  ~ pip3 install jupyter
...
Successfully built pandocfilters
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/.equests-2.21.0.dist-info/METADATA'

解决办法

  1. 到该路径下查看文件:
➜  ~ cd /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/.equests-2.21.0.dist-info
➜  .equests-2.21.0.dist-info ls
requests-2.21.0.dist-info
➜  .equests-2.21.0.dist-info cd requests-2.21.0.dist-info
➜  requests-2.21.0.dist-info ls
INSTALLER     LICENSE       METADATA      RECORD        WHEEL         top_level.txt
可以发现目录层级跟预期不同。
  1. 把需要的METADATA以及其他可能需要的文件一起复制到上层目录:
➜  requests-2.21.0.dist-info cp * ..
  1. 再次安装,成功:
Successfully installed Send2Trash-1.5.0 appnope-0.1.0 backcall-0.1.0 bleach-3.1.0 decorator-4.4.0 defusedxml-0.6.0 entrypoints-0.3 ipykernel-5.1.1 ipython-7.6.1 ipython-genutils-0.2.0 ipywidgets-7.5.0 jedi-0.14.1 jinja2-2.10.1 jsonschema-3.0.1 jupyter-1.0.0 jupyter-client-5.3.1 jupyter-console-6.0.0 jupyter-core-4.5.0 mistune-0.8.4 nbconvert-5.5.0 nbformat-4.4.0 notebook-6.0.0 pandocfilters-1.4.2 parso-0.5.1 pexpect-4.7.0 pickleshare-0.7.5 prometheus-client-0.7.1 prompt-toolkit-2.0.9 ptyprocess-0.6.0 pygments-2.4.2 pyrsistent-0.15.3 python-dateutil-2.8.0 pyzmq-18.0.2 qtconsole-4.5.1 terminado-0.8.2 testpath-0.4.2 tornado-6.0.3 traitlets-4.3.2 wcwidth-0.1.7 webencodings-0.5.1 widgetsnbextension-3.5.0

后续

  1. 该目录为啥层级不对;
  2. 这样复制是否有其他影响。
    以上两点之后再补充吧,有问题再解决就是了。
相关标签: pip jupyter