无法在virtualen中安装pip为的html包

2024-04-24 07:47:35 发布

您现在位置:Python中文网/ 问答频道 /正文

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

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

现在,我想为这个项目安装一些只有pip的软件包,我做到了:

^{pr2}$

我得到了以下错误(完全回溯,但我用“…”替换了路径):

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

注意对于python2.7.5(mac上的默认版本),我可以在全局范围内安装此包而不会出现问题。在

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


Tags: 项目infrompyimportbinvenvlib
1条回答
网友
1楼 · 发布于 2024-04-24 07:47:35

此包已过时,与当前的打包工具不兼容,它的上一次发布是在8年前。我真的怀疑很久以前发布的包是否仍然可以用于最近的python(s)。在

相关问题 更多 >