pip 安装 livetest 失败
- 1. 现象
- 2. 解决方案
- (1) 下载
- (2) 移动并解压
- (3) 修改文件
- 1) livetest-0.5/livetest/__init__.py
- 2) livetest-0.5/setup.py
- 3) livetest-0.5/test/test_select.py
- (4) 运行安装
- 4. 验证
1. 现象
pip 安装 livetest 失败
2. 解决方案
(1) 下载
官网下载 livetest 包
(2) 移动并解压
移动到 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages 目录下,并解压
(3) 修改文件
1) livetest-0.5/livetest/init.py
import httplib -> import http.client as httplib
import urlparse -> import urllib.parse
from Cookie import BaseCookie, CookieError -> import http.cookiejar
XXXError, e -> XXXError as e
2) livetest-0.5/setup.py
long_description=file('README.rst').read() -> long_description=open('README.rst').read()
version=livetest.__version__ -> version='0.5'
author_email=livetest.__author__ -> author_email='storborg@mit.edu'
3) livetest-0.5/test/test_select.py
XXXError, e -> XXXError as e
(4) 运行安装
切换到 /livetest-0.5 下,执行安装指令:
sudo python3 setup.py install
4. 验证
pip show livetest