【编程BUG解决】安装streamlit包报错解决

1 背景

使用pip安装streamlit时(VPN已打开),报错:

ERROR: Could not build wheels for argon2-cffi-bindings which use PEP 517 and cannot be installed dir

2 解决方法

报错如下:

Requirement already satisfied: pycparser in d:\applications\miniconda3\lib\site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets>=7.0.0->pyde
ck>=0.1.dev5->streamlit) (2.19)
Building wheels for collected packages: argon2-cffi-bindings
  Building wheel for argon2-cffi-bindings (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'D:\Applications\Miniconda3\python.exe' 'D:\Applications\Miniconda3\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\liual\AppData\Local\Temp\tmpokn6f00o'
       cwd: C:\Users\liual\AppData\Local\Temp\pip-install-eue0fza4\argon2-cffi-bindings
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-37
  creating build\lib.win-amd64-cpython-37\_argon2_cffi_bindings
  copying src\_argon2_cffi_bindings\_ffi_build.py -> build\lib.win-amd64-cpython-37\_argon2_cffi_bindings
  copying src\_argon2_cffi_bindings\__init__.py -> build\lib.win-amd64-cpython-37\_argon2_cffi_bindings
  running build_ext
  generating cffi module 'build\\temp.win-amd64-cpython-37\\Release\\_ffi.c'
  creating build\temp.win-amd64-cpython-37
  creating build\temp.win-amd64-cpython-37\Release
  building '_ffi' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for argon2-cffi-bindings
  Running setup.py clean for argon2-cffi-bindings
Failed to build argon2-cffi-bindings
Building wheels for collected packages: validators, blinker
  Building wheel for validators (setup.py) ... done
  Created wheel for validators: filename=validators-0.20.0-cp37-none-any.whl size=19572 sha256=a9f2e210e63345e313dc3dde6d740f723f8771f1989cb1d5d5cb3dd3af62a514
  Stored in directory: C:\Users\liual\AppData\Local\pip\Cache\wheels\78\02\9b\6792cb888287d119f314664ab5e7579eaff131cccf18815757
  Building wheel for blinker (setup.py) ... done
  Created wheel for blinker: filename=blinker-1.4-cp37-none-any.whl size=13452 sha256=5b96998662d0dc44acd26e267c44f946708e1dcda067ce180da030f31982e59e
  Stored in directory: C:\Users\liual\AppData\Local\pip\Cache\wheels\92\a0\00\8690a57883956a301d91cf4ec999cc0b258b01e3f548f86e89
Successfully built validators blinker
ERROR: Could not build wheels for argon2-cffi-bindings which use PEP 517 and cannot be installed directly

可以发现,部分依赖包包是安装成功了的,于是我使用

python -m pip install --user --upgrade pip

更新了pip,重试,就可以了:

Successfully installed MarkupSafe-2.1.1 Send2Trash-1.8.0 altair-4.2.0 argon2-cffi-21.3.0 argon2-cffi-bindings-21.2.0 attrs-21.4.0 backcall-0.2.0 backports.zoneinfo-0.2.1 beautifulsoup4-4.11.1 bleach-5.0.0 blink
er-1.4 cachetools-5.2.0 click-8.1.3 colorama-0.4.5 commonmark-0.9.1 debugpy-1.6.0 decorator-5.1.1 defusedxml-0.7.1 entrypoints-0.4 fastjsonschema-2.15.3 gitdb-4.0.9 gitpython-3.1.27 importlib-resources-5.8.0 ip
ykernel-6.15.0 ipython-7.34.0 ipython-genutils-0.2.0 ipywidgets-7.7.0 jedi-0.18.1 jinja2-3.1.2 jsonschema-4.6.0 jupyter-client-7.3.4 jupyter-core-4.10.0 jupyterlab-pygments-0.2.2 jupyterlab-widgets-1.1.0 matplo
tlib-inline-0.1.3 mistune-0.8.4 nbclient-0.6.4 nbconvert-6.5.0 nbformat-5.4.0 nest-asyncio-1.5.5 notebook-6.4.12 pandocfilters-1.5.0 parso-0.8.3 pickleshare-0.7.5 prometheus-client-0.14.1 prompt-toolkit-3.0.29
protobuf-3.20.1 psutil-5.9.1 pyarrow-8.0.0 pydeck-0.7.1 pygments-2.12.0 pympler-1.0.1 pyrsistent-0.18.1 pytz-deprecation-shim-0.1.0.post0 pywinpty-2.0.5 pyzmq-23.1.0 rich-12.4.4 semver-2.13.0 smmap-5.0.0 soupsi
eve-2.3.2.post1 streamlit-1.10.0 terminado-0.15.0 tinycss2-1.1.1 toml-0.10.2 toolz-0.11.2 traitlets-5.3.0 tzdata-2022.1 tzlocal-4.2 validators-0.20.0 watchdog-2.1.9 wcwidth-0.2.5 webencodings-0.5.1 widgetsnbext
ension-3.6.0

你可能感兴趣的:(经验干货,编程小知识杂记,python)