无法在virtualenv

时间:2015-05-14 08:13:10

标签: python pip 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

1 个答案:

答案 0 :(得分:0)

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