老师,这个还是安装失败两个方法都不行。
来源:4-1 BeautifulSoup4的安装与应用
热爱编程学习
2021-09-12 14:28:07
python -m pip install --upgrade pip
Exception:
Traceback (most recent call last):
File "D:\Python3\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\cli\base_command.py", line 179, in main
status = self.run(options, args)
File "D:\Python3\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\commands\install.py", line 384, in run
installed = install_given_reqs(
File "D:\Python3\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\req\__init__.py", line 53, in install_given_reqs
requirement.install(
File "D:\Python3\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\req\req_install.py", line 910, in install
self.move_wheel_files(
File "D:\Python3\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\req\req_install.py", line 437, in move_wheel_files
move_wheel_files(
File "D:\Python3\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\wheel.py", line 544, in move_wheel_files
generated.extend(maker.make(spec))
File "D:\Python3\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\distlib\scripts.py", line 405, in make
self._make_script(entry, filenames, options=options)
File "D:\Python3\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\distlib\scripts.py", line 309, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "D:\Python3\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\distlib\scripts.py", line 245, in _write_script
launcher = self._get_launcher('t')
File "D:\Python3\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\distlib\scripts.py", line 384, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
方法二
pip install lxml‑4.3.1‑cp34‑cp34m‑win_amd64.whl
lxml?4.3.1?cp34?cp34m?win_amd64.whl is not a valid wheel filename.
1回答
同学,你好!
1、可以使用此命令:python -m pip install -U --force-reinstall pip 对pip进行升级
2、 安装wheel,命令行运行:pip install wheel
3、在这里下载对应的.whl文件(注意版本需要下载与python解释器相同),注意别改文件名!http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
4、 进入.whl所在的文件夹(放在pycharm中直接安装),执行命令即可完成安装:pip install 带后缀的完整文件名
祝学习愉快~
相似问题