gpt4 book ai didi

python - 无法在virtualenv中使用pip安装html包

转载 作者:太空狗 更新时间:2023-10-30 01:37:57 26 4
gpt4 key购买 nike

在我的根项目文件夹中,我使用以下命令为 python 3.4 创建了一个虚拟环境:

$ virtualenv -p /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 venv
$ source venv/bin/activate

现在我想用 pip 只为这个项目安装一些包,我这样做了:

$ venv/bin/pip install html

我得到以下错误(完整的回溯,除了我用'...'替换了路径):

Collecting html
Using cached html-1.16.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 2218, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<string>", line 3, in <module>
File ".../venv/lib/python3.4/site-packages/setuptools/__init__.py", line 11, in <module>
from setuptools.extension import Extension
File ".../venv/lib/python3.4/site-packages/setuptools/extension.py", line 8, in <module>
from .dist import _get_unpatched
File ".../venv/lib/python3.4/site-packages/setuptools/dist.py", line 16, in <module>
from setuptools.depends import Require
File ".../venv/lib/python3.4/site-packages/setuptools/depends.py", line 6, in <module>
from setuptools import compat
File ".../venv/lib/python3.4/site-packages/setuptools/compat.py", line 44, in <module>
from html.entities import name2codepoint
ImportError: No module named 'html.entities'; 'html' is not a package

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/xz/15p_y6cn09bdc55vkvx6vrd80000gn/T/pip-build-lgl2qvpz/html

请注意,我可以毫无问题地为 python 2.7.5 全局安装此软件包,这是我 mac 上的默认版本。

我要安装的包是这个: https://pypi.python.org/pypi/html/1.16

最佳答案

这个包已经过时,与当前的打包工具不兼容,它的最后一个版本是 8 年多以前的。我真的怀疑很久以前发布的包是否仍然可以用于最近的 python。

关于python - 无法在virtualenv中使用pip安装html包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30232451/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com