[英]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.