啥也不说了,眼泪哗哗的 –来自怨念深重的不灵狗。
还想要错误提示?提示你妹啊!卡住之后根本没有错误提示。
(venv)➜ flask-mongoengine-0.7.5 pip install flask-mongoengine --proxy=http://proxy.xxx.com:80 -v
Collecting flask-mongoengine
1 location(s) to search for versions of flask-mongoengine:
* http://pypi.douban.com/simple/flask-mongoengine/
Getting page http://pypi.douban.com/simple/flask-mongoengine/
Starting new HTTP connection (1): proxy.corp.qihoo.net
"GET http://pypi.douban.com/simple/flask-mongoengine/ HTTP/1.1" 301 178
"GET http://pypi.doubanio.com/simple/flask-mongoengine/ HTTP/1.1" 200 1068
Analyzing links from page http://pypi.doubanio.com/simple/flask-mongoengine/
Found link http://pypi.doubanio.com/packages/f3/46/e527ea37dd53e5addae8167c2e5850029c7be98add465928cac7d1d10d0e/flask-mongoengine-0.7.5.tar.gz#md5=e207998d4ab5237582c4983cd18ab484 (from http://pypi.doubanio.com/simple/flask-mongoengine/), version: 0.7.5
Using version 0.7.5 (newest of versions: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7.0, 0.7.1, 0.7.3, 0.7.4, 0.7.5)
"GET http://pypi.doubanio.com/packages/f3/46/e527ea37dd53e5addae8167c2e5850029c7be98add465928cac7d1d10d0e/flask-mongoengine-0.7.5.tar.gz HTTP/1.1" 200 110621
Downloading http://pypi.doubanio.com/packages/f3/46/e527ea37dd53e5addae8167c2e5850029c7be98add465928cac7d1d10d0e/flask-mongoengine-0.7.5.tar.gz (110kB)
Downloading from URL http://pypi.doubanio.com/packages/f3/46/e527ea37dd53e5addae8167c2e5850029c7be98add465928cac7d1d10d0e/flask-mongoengine-0.7.5.tar.gz#md5=e207998d4ab5237582c4983cd18ab484 (from http://pypi.doubanio.com/simple/flask-mongoengine/)
100% |████████████████████████████████| 112kB 44.5MB/s
Running setup.py (path:/tmp/pip-build-5h86uM/flask-mongoengine/setup.py) egg_info for package flask-mongoengine
Running command python setup.py egg_info
#卡在这里不动了
^CCleaning up...
Operation cancelled by user
123456789101112131415161718192021
笔者没有找到比较优美的方式解决问题,在pip.conf中没有设置二次安装时指定源的方法,英文好的可以再研究下pip使用的官方文档.
1. root用户下编辑文件/usr/lib/python2.7/dist-packages/setuptools/package_index.py;
2. 插下广告:用virtualenv的同学要修改venv目录下的./lib/python2.7/site-packages/setuptools/package_index.py。
3. 跳到第261行,硬编码index_url的值,改完后如下:
class PackageIndex(Environment):
"""A distribution index that scans web pages for download URLs"""
def __init__(
self, index_url="http://pypi.douban.com/simple", hosts=('*',),
ca_bundle=None, verify_ssl=True, *args, **kw
):
Environment.__init__(self,*args,**kw)
index_url = "http://pypi.douban.com/simple"
self.index_url = index_url + "/"[:not index_url.endswith('/')]
12345678910
pip install flask-mongoengine
,贴一下成功后的提示(holy shit!) ...
done
Removing source in /tmp/pip-build-ZSaB9M/flask-mongoengine
Successfully installed WTForms-2.1 flask-mongoengine-0.7.5 flask-wtf-0.12
Cleaning up...
123456
csdn做的markdown这SX玩应儿,在numbered list 中间插个code block,代码块后的序号就对不上了,用官方的解决方案完全没用,只能给最后一条分出个标题了,可怜处女座了。