1.HTTPError: 404 Client Error: Not Found for url: ...的错误

ubuntu@VM-0-6-ubuntu:~/myprojects$ virtualenv venv
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/ubuntu/myprojects/venv/bin/python2
Also creating executable in /home/ubuntu/myprojects/venv/bin/python
Please make sure you remove any previous custom paths from your /home/ubuntu/.pydistutils.cfg file.
Installing setuptools, pkg_resources, pip, wheel...
Complete output from command /home/ubuntu/myprojects/venv/bin/python2 - setuptools pkg_resources pip wheel: Collecting setuptools
Downloading http://mirrors.tencentyun.com/pypi/packages/6a/9a/50fadfd53ec909e4399b67c74cc7f4e883488035cfcdb90b685758fa8b34/setuptools-41.4.0-py2.py3-none-any.whl (580kB)
Collecting pkg_resources
Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/commands/install.py", line 328, in run
wb.build(autobuilding=True)
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/wheel.py", line 748, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/req/req_set.py", line 360, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/req/req_set.py", line 512, in _prepare_file
finder, self.upgrade, require_hashes)
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/req/req_install.py", line 273, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/index.py", line 442, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/index.py", line 400, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/index.py", line 545, in _get_pages
page = self._get_page(location)
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/index.py", line 648, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/index.py", line 760, in get_page
resp.raise_for_status()
File "/home/ubuntu/myprojects/venv/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/models.py", line 840, in raise_for_status
raise HTTPError(http_error_msg, response=self)
HTTPError: 404 Client Error: Not Found for url: http://mirrors.tencentyun.com/pypi/simple/pkg-resources/
----------------------------------------
...Installing setuptools, pkg_resources, pip, wheel...done.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/virtualenv.py", line 2363, in <module>
main()
File "/usr/lib/python3/dist-packages/virtualenv.py", line 719, in main
symlink=options.symlink)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 988, in create_environment
download=download,
File "/usr/lib/python3/dist-packages/virtualenv.py", line 918, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 812, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/ubuntu/myprojects/venv/bin/python2 - setuptools pkg_resources pip wheel failed with error code 2

Error

解决方案:修改pip源

vim ~/.pip/pip.conf打开pip配置文件: 

[global]
index-url = http://e.pypi.python.org/simple

注意点:

vim ~/.pip/pip.conf 是打开当前用户下的pip配置文件
百度说修改/root/.pip/pip.conf文件,于是我用root账户进行了修改
这样其实是修改root账户的pip配置文件,这样会导致在当前用户下无效果,这点要注意。

[Flask] 安装virtualenv时候出现的问题的更多相关文章

  1. 在centOS7.2里安装virtualenv和flask

    1) 安装pip工具 #wget https://bootstrap.pypa.io/get-pip.py #python get-pip.py 2) 安装virtualenv,并创建一个开发环境 # ...

  2. flask安装及第一个程序

    1.flask是一个轻量级的python web框架 ·1.Flask 依赖两个外部库: Jinja2 模板引擎和 Werkzeug WSGI 套件 ·2.安装: # easy_install fla ...

  3. 【转】Flask安装

    Flask 依赖两个外部库:Werkzeug 和 Jinja2 . Werkzeug 是一个 WSGI(在 Web 应用和多种服务器之间的标准 Python 接口) 工具集.Jinja2 负责渲染模板 ...

  4. Flask 安装 Ubuntu 14.04

    学习文档: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world 中文版学习文档 开源中国版: ...

  5. flask安装首页显示

    参考:http://flask.pocoo.org/1.安装和测试[root@node1 flask]#pip install flaskd[root@node1 flask]# cat app.py ...

  6. windows下安装virtualenv并且配置指定环境

    下面是在windows下通过virtualenv创建虚拟环境, 包括 : 1. 安装virtualenv(使用pip可直接安装) 2. 使用virtualenv创建指定版本的虚拟环境 3. 进入虚拟环 ...

  7. Flask+uwsgi+virtualenv环境配置

    Linux系统版本: SLES12sp3 (阿里云) 1. 首先需要安装python-devel,否则后续安装会报错! rpm -qa|grep python-base 结果: python-base ...

  8. Flask安装教程

    第1步:确保本机已经安装有python,下载easy_install到本地某一目录,双击ez_setup.py,python将自动下载到python安装目录/Scripts 下面,然后在系统环境变量的 ...

  9. 安装virtualenv(Scrapy)

    Windows 10家庭中文版,Python 3.6.4, virtualenv用来提供一个应用程序独立的 运行环境,这个独立是相对于系统的Python运行环境而言,开发者可以在virtualenv建 ...

随机推荐

  1. centos k3s部署

    目录 一.k3s介绍 二.在线安装 三.离线安装 四.高可用安装 五.配置k3s镜像仓库 六.Kubernetes 仪表盘 七.常用命令 八.参考 一.k3s介绍 1.k3s是一个轻量级的 Kuber ...

  2. String类源码分析

    1.String类注释说明 /** * The {@code String} class represents character strings. All * string literals in ...

  3. Matalb 正则表达式预处理数据(一)

    clc clear %% Step 1: 读入数据 phasedata = readtable('phasedata.txt'); %% Step 2: 提取数据 time = phasedata(: ...

  4. HGAME2021 week3 pwn writeup

    一共放出五道题,都不是很难. blackgive 考栈转移,值得注意的一点是转移过去先填充几个ret,因为如果直接在转移过去的地方写rop链,执行起来会覆盖到上面的一些指针,导致程序不能正常输入和输出 ...

  5. 替换资源(Project)

    <Project2016 企业项目管理实践>张会斌 董方好 编著 还是那个熟悉的某吃货甲,一天之内给他分配了9.6个工时的吃量,这太不厚道了哈,人家一个人又要开吃又要喝汤,这怎么吃得消呢? ...

  6. Arcpy按属性(字段值)不同将shp分割为多个独立shp_适用点线面矢量

    利用代码可以进行批量处理,安装有10.5及以上版本ArcGIS可以使用工具Split by attributes完成上述任务 # -*- coding: utf-8 -*- # Import syst ...

  7. LuoguP7694 [COCI2009-2010#4] AUTORI 题解

    Content 科学论文会大量引用一些早期的著作,因此在一个论文中出现两种不同的命名约定并不少见.这两种不同的命名约定分别是: 长变体,由每个作者姓氏的完整单词由连字符连接而成,例如 Knuth-Mo ...

  8. WebApi的前端调用

    WebApi前端调用 HTML代码: <!DOCTYPE html><html> <head> <meta charset="utf-8" ...

  9. Tomcat高级特性及性能调优

    Tomcat对Https的支持 HTTPS简介 Https,是以安全为目标的Http通道,在Http的基础上通过传输加密和身份认证保证了传输的安全性.HTTPS在HTTP的基础上加入SSL层,HTTP ...

  10. nim_duilib(15)之duilib属性列表.xml

    Note 为了更加方便查看duilib的属性(github有时候打不开),特此记录. 阅读本文,可以知道控件有哪些属性,可以写在xml文件中.个别需要结合源码一起看 from here 原文 < ...