当你想要在conda指定的某个环境中安装包的方法

1)使用conda install -n 环境名 包名

userdeMBP:pytorch user$ conda install -n deeplearning2 tensorflow

2)进入环境,在环境中使用pip install命令:

userdeMacBook-Pro:classifier cifar user$ conda activate deeplearning
(deeplearning) userdeMacBook-Pro:classifier cifar user$ pip install tensorflow
Collecting tensorflow
...

然后查看:

(deeplearning) userdeMBP:~ user$ python
Python 3.7.2 (default, Dec 29 2018, 00:00:04)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>> tensorflow.__version__
‘1.13.1‘
>>> 

可见安装了1.13.1版本的tensorflow

原文地址:https://www.cnblogs.com/wanghui-garcia/p/10605608.html

时间: 2024-08-30 07:40:08

当你想要在conda指定的某个环境中安装包的方法的相关文章

log4j:特定类的日志输出到指定的日志文件中

问题描述:我有一个类foo.bar.Baz,我想让Baz这个类的日志输出到指定的日志文件中,其它的就使用默认的配置. log4j.rootLogger=ERROR, logfile log4j.appender.logfile=org.apache.log4j.DailyRollingFileAppender log4j.appender.logfile.datePattern='-'dd'.log' log4j.appender.logfile.File=log/radius-prod.log

Ubuntu18.0 解决python虚拟环境中不同用户下或者python多版本环境中指定虚拟环境的使用问题

一. 不同用户下配置virtualenvwrapper的问题 问题描述: 安装virtualnev和virtualnevwrapper之后,在.bashrc进行virtualenvwrapper的相关配置后重新加载.bashrc文件时报错. 报错内容大致如下: /usr/bin/python: No module named virtualenvwrapper virtualenvwrapper.sh: There was a problem running the initialization

apache指定的网络名不再可用错误解决方法

系统平台:  window server 2003  R2 service Pack 2 网站服务器环境:wamp [ apache:2.4.4 ]; 问题描述:服务器工作一点时间就出现假死状态,网站无法访问.查看apache错误日志出现如下错误: 在google上找到如下系列文章:http://jingyan.baidu.com/article/154b4631a9d5b828ca8f4198.html http://hi.baidu.com/h_appy/item/ed13fb2ad0fa2

在安装包运行时指定Component的安装路径

Basic MSI工程类型中如果实现动态指定安装路径的功能,下面介绍的方法也适用于InstallScript MSI工程. 1. 在Setup Design中找到相对应的Component. 2. 点击Destination的后侧的“...”按键. 3. 在Browse for Directory对话框中,选中Destination Computer后点击鼠标右键选择“New Directory” ,默认会参数一个NEW_DIRECTORY1,点击OK. 4. 在Property Manager

jQuery移除指定id的div中指定id的img元素

做项目的过程中,我通过jQuery动态向指定id的div中添加img元素,然后点击删除按钮可以删除指定id的img $("#showimg").find("img[id='"+file.id+"']").remove(); showimg是div的id,file.id是img的id,我直接用$("#"+file.id).remove()删除不了这个img,我也不知道为啥,就用的上面的删除了 有哪个大侠知道为啥的话,告诉我哦,多

通过 JDBC 向指定的数据表中插入一条记录,查询记录

//通过 JDBC 向指定的数据表中插入一条记录 /*  * 1.Statement: 用于执行SQl语句的对象  *  通过Connection 的createStatement()方法来获取  *  通过executeUptate(sql) 可执行sql语句  *  传入的sql 可以是 insert , update, delete 但不能是select  * 2.Connection 和 Statement 需要关闭  *  需要在finally中关闭  * 3.关闭的顺序:先关闭后获取

获取指定目录及子目录中所有文件列表

#region 获取指定目录及子目录中所有文件列表 /// <summary> /// 获取指定目录及子目录中所有文件列表 /// </summary> /// <param name="directoryPath">指定目录的绝对路径</param> /// <param name="searchPattern">模式字符串,"*"代表0或N个字符,"?"代表1个字

pip 安装包时指定pypi资源地址

今天安装mycli的时候,一直有个报错,报gcc错误,本来就是一键安装的事,折腾了老半天.什么yum install gcc gcc-c++ 一顿操作,完全无效,又配置epel,还是不给面子:只能试试[pip 安装包时指定pypi资源地址]使用阿里云的也没有安装成功cryptography pip install -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com cryptography pip install my

conda创建的环境中使用sudo pip的问题

@font-face{ font-family:"Times New Roman"; } @font-face{ font-family:"宋体"; } @font-face{ font-family:"Calibri"; } @font-face{ font-family:"SimSun"; } p.MsoNormal{ mso-style-name:Normal; mso-style-parent:""