繁体   English   中英

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

[英]Cannot install html package with pip in virtualenv

在我的根项目文件夹中,我使用以下命令为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

请注意 ,对于我的mac上的默认版本python 2.7.5,我可以全局安装此软件包。

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

该软件包已过时,与当前的包装工具不兼容,其最新版本发布于8年前。 我真的怀疑很久以前发布的软件包仍可用于最近的python。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM