我想在虛擬環(huán)境中安裝 bs4,但是發(fā)生了錯誤,我不知道為什么。我已經更新了 bs4、pip 和 pipenv。這是錯誤:C:\Users\ACER\Desktop\PYTEST\temp>pipenv install beautifulsoup4Installing beautifulsoup4…Adding beautifulsoup4 to Pipfile's [packages]…Installation SucceededInstalling dependencies from Pipfile.lock (06c5f2)…An error occurred while installing beautifulsoup==3.2.2 --hash=sha256:a04169602bff6e3138b1259dbbf491f5a27f9499dea9a8fbafd48843f9d89970 --hash=sha256:d31413d71f6ca027ff6b06c891b62ee8ff48267ccd969f881d810e5d1fe49565! Will try again. ================================ 9/9 - 00:00:05Installing initially failed dependencies…[pipenv.exceptions.InstallError]: File "c:\users\acer\appdata\local\programs\python\python37\lib\site-packages\pipenv\core.py", line 1992, in do_install[pipenv.exceptions.InstallError]: skip_lock=skip_lock,[pipenv.exceptions.InstallError]: File "c:\users\acer\appdata\local\programs\python\python37\lib\site-packages\pipenv\core.py", line 1253, in do_init[pipenv.exceptions.InstallError]: pypi_mirror=pypi_mirror,[pipenv.exceptions.InstallError]: File "c:\users\acer\appdata\local\programs\python\python37\lib\site-packages\pipenv\core.py", line 859, in do_install_dependencies[pipenv.exceptions.InstallError]: retry_list, procs, failed_deps_queue, requirements_dir, **install_kwargs[pipenv.exceptions.InstallError]: File "c:\users\acer\appdata\local\programs\python\python37\lib\site-packages\pipenv\core.py", line 763, in batch_install[pipenv.exceptions.InstallError]: _cleanup_procs(procs, not blocking, failed_deps_queue, retry=retry)[pipenv.exceptions.InstallError]: File "c:\users\acer\appdata\local\programs\python\python37\lib\site-packages\pipenv\core.py", line 681, in _cleanup_procs[pipenv.exceptions.InstallError]: raise exceptions.InstallError(c.dep.name, extra=err_lines)
3 回答

慕后森
TA貢獻1802條經驗 獲得超5個贊
錯誤消息格式錯誤,但信息在那里......
“您正試圖在 Python 3 下運行非常舊的 Beautiful Soup 版本。這將不起作用?!?lt;>“請使用 Beautiful Soup 4,可通過 pip 包 \'beautifulsoup4\' 獲得?!?/p>
同樣在您的跟蹤開始時,它清楚地表明它正在嘗試安裝beautifulsoup
,顯然是因為它在您的Pipfile.lock
. 顯然你想要beautifulsoup4
。只要解決這個問題,你就可以開始了。

婷婷同學_
TA貢獻1844條經驗 獲得超8個贊
pipenv
已成功安裝beautifulsoup4
,在跟蹤中可以看到:
正在安裝 beautifulsoup4...
將 beautifulsoup4 添加到 Pipfile 的 [packages]...
安裝成功
該錯誤發(fā)生在pipenv
嘗試完成先前失敗的依賴項的安裝之后,在這種情況下beautifulsoup 3.2.2
。beautifulsoup
要解決此問題,您應該使用以下命令從Pipfile.lock
依賴項中刪除舊版本:
pipenv uninstall beautifulsoup
添加回答
舉報
0/150
提交
取消