pip install http://download.pytorch.org/whl/cu80/torch-0.2.0.post3-cp27-cp27mu-manylinux1_x86_64.whl 
pip install torchvision

今天在按照上面的命令安装pytorch的时候,首先将whl文件下载到本地,然后直接pip install该文件,再安装的时候报错,TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' ,

这个问题我是修改了pip的源解决的,参考这篇博客,将豆瓣源写到相应的文件中,然后第一步就成功了。

安装完第一步之后,再执行pip install torchvision的时候,又出现了如下的问题:这个是由于pip的版本太低引起的,后来搜到了这篇博客,运行如下的命令对pip进行升级:

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-NQWkHo/torch/
sudo python -m pip install --upgrade --force pip

然后就安装成功了

后面在使用python setup.py的时候,又出现了问题,从显示的信息是网络连接不上,默认是从这个网址进行下载https://pypi.python.org/simple/,

然后搜到了这篇博客,也就是pip install与通过python setup.py文件进行安装是解析的不同的文件,这个则需要建立~/.pydistutils.cfg来配置distutils的源

~/.pydistutils.cfg

1
2
[easy_install]
index_url = http://pypi.douban.com/simple

将该文件编辑保存之后,再次运行 python setup.py很快就可以装上了。

后来豆瓣源不起作用了,又换成了清华源:

gedit ~/.pip/pip.conf

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=pypi.douban.com

python pip install 报错TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' Command "python setup.py egg_info" failed with error code 1 in的更多相关文章

  1. 解决pip安装时出现报错TypeError unsupported operand type(s) for -= 'Retry' and 'int'

    1.参考 https://stackoverflow.com/questions/42610545/typeerror-unsupported-operand-types-for-retry-and- ...

  2. pip安装mysql-python报错:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-enRreC/mysql-python/

    公司业务开发,用python开发网站;需要使用模块MySQLdb. 我直接pip install MySQLdb,当然不成功了,模块名字因该是mysql-python pip install mysq ...

  3. python下pip 安装 pyautogui报错Command "python setup.py egg_info" failed with error code 1 in C:\Users\Administrator\AppData\Local\Temp\pip-install-svhtepho\pygetwindow\

    python装的3.6 64位,使用命令pip install pyautogui 或者pip install -U pyautogui 都失败了 报错如下: Command "python ...

  4. python pip安装报错python setup.py egg_info failed with error code 1

    安装locust遇到点问题折腾了好一会儿,记录一下. 使用命令pip install locustio提示python setup.py egg_info  failed with error cod ...

  5. pip安装报错Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-e_k8hq6a/pynacl/

    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-e_k8hq6a/pyn ...

  6. python2 使用pip安装psycopg2出现错误:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-mvzdNj/psycopg2/

    公司业务需求,开发语言python2,需要使用数据库:postgresql,需要安装模块psycopg2这个模块, 使用pip install psycopg2 报错: Command "p ...

  7. Command "python setup.py egg_info" failed with error code 10

    1:今天系统重装以后,下载了新的版本的python3.6.1.然后想通过pycurl模块测试URL,突然发现windows10下我无法通过pip安装pycurl模块了,报错内容如下 Collectin ...

  8. Command "python setup.py egg_info" failed with error code 1一种问题的解决方法

    问题描述:无论是你在pycharm中直接使用import and install命令,还是pip的时候出现了Command "python setup.py egg_info" f ...

  9. Command "python setup.py egg_info" failed with error code 1 in C:\Users\w5659\AppData\Local\Temp\pip-install-t7uomu4r\xa dmin\

    Error msg: C:\Users\w5659>pip install xadmin Collecting xadmin Using cached https://files.pythonh ...

随机推荐

  1. headfirst python 05, 06

    处理数据 with open('james.txt') as jaf: data = jaf.readLine() james = data.strip().split(',') #先去掉空格而否有, ...

  2. C艹目录

    c++ 学习路线  c++学习路线 c++ 学习目录 c++ 常用数据类型,命名规则, 不常有数据类型 C++复合类型(数组) C艹复合类型(字符串) C++复合类型(结构体) C++ 结构体和枚举 ...

  3. Spark学习笔记——基于MLlib的机器学习

    使用MLlib库中的机器学习算法对垃圾邮件进行分类 分类的垃圾邮件的如图中分成4个文件夹,两个文件夹是训练集合,两个文件夹是测试集合 build.sbt文件 name := "spark-f ...

  4. 工具链接redis

    RedisDesktopManager 链接 文件位置 /usr/loca/redis/etc/redis.conf 一.注释redis.conf文件中的:bind 127.0.0.1(在一段文字之前 ...

  5. [Converge] Gradient Descent - Several solvers

    solver : {‘newton-cg’, ‘lbfgs’, ‘liblinear’, ‘sag’}, default: ‘liblinear’ Algorithm to use in the op ...

  6. Fiddler 使用命令行

    在 Fiddler 界面左下角处,可以输出一些快捷命令,常用的快捷命令如下: help:查看命令帮助cls:清屏,即清空会话列表中的所有会话select:选择某一类型的会话,如 select html ...

  7. 【laravel5.6】 laravel中间件内生成参数并且传递到控制器的2种方法

    中间件方法: /** * 自定义中间件: * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return ...

  8. 十三、K3 WISE 开发插件《SQL语句WHERE查询-范围查询/模糊查询》

    0.存储过程开头变量定义 ), --单据起始日期 ), --单据截止日期. ), ), ), ), ) @FType varchar(50),  --单据类型@FBillNo varchar(50), ...

  9. 录制用户的音频,视屏 navigator.mediaDevices.getUserMedia

    google 文档 HACKS 文档 相关代码 获取本地的音频 <input type="file" accept="audio/*" capture=& ...

  10. LogisticRegression 和 LogisticRegressionCV

    在scikit-learn中,与逻辑回归有关的主要是这3个类.LogisticRegression, LogisticRegressionCV 和logistic_regression_path.其中 ...