conda创建新环境

conda create --name yourEnv python=2.7
#或者
conda create -n yourEnv python=3.6 numpy pandas

激活环境并且安装相关包

zutnlp@zutnlp:~$ source activate wyd_dl
(wyd_dl) zutnlp@zutnlp:~$ python
Python 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Keras
Traceback (most recent call last):File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Keras'
>>> import keras
Traceback (most recent call last):File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'keras'
>>> exit()
(wyd_dl) zutnlp@zutnlp:~$ pip install keras
Collecting kerasUsing cached https://files.pythonhosted.org/packages/5e/10/aa32dad071ce52b5502266b5c659451cfd6ffcbf14e6c8c4f16c0ff5aaab/Keras-2.2.4-py2.py3-none-any.whl
Requirement already satisfied: scipy>=0.14 in ./anaconda3/envs/wyd_dl/lib/python3.6/site-packages (from keras) (1.2.1)
Collecting keras-preprocessing>=1.0.5 (from keras)Downloading https://files.pythonhosted.org/packages/28/6a/8c1f62c37212d9fc441a7e26736df51ce6f0e38455816445471f10da4f0a/Keras_Preprocessing-1.1.0-py2.py3-none-any.whl (41kB)|████████████████████████████████| 51kB 20kB/s
Collecting pyyaml (from keras)Downloading https://files.pythonhosted.org/packages/a3/65/837fefac7475963d1eccf4aa684c23b95aa6c1d033a2c5965ccb11e22623/PyYAML-5.1.1.tar.gz (274kB)|████████████████████████████████| 276kB 19kB/s
Requirement already satisfied: six>=1.9.0 in ./anaconda3/envs/wyd_dl/lib/python3.6/site-packages (from keras) (1.12.0)
Collecting keras-applications>=1.0.6 (from keras)Downloading https://files.pythonhosted.org/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl (50kB)|████████████████████████████████| 51kB 22kB/s
Requirement already satisfied: numpy>=1.9.1 in ./anaconda3/envs/wyd_dl/lib/python3.6/site-packages (from keras) (1.16.2)
Requirement already satisfied: h5py in ./anaconda3/envs/wyd_dl/lib/python3.6/site-packages (from keras) (2.9.0)
Building wheels for collected packages: pyyamlBuilding wheel for pyyaml (setup.py) ... doneStored in directory: /home/zutnlp/.cache/pip/wheels/16/27/a1/775c62ddea7bfa62324fd1f65847ed31c55dadb6051481ba3f
Successfully built pyyaml
Installing collected packages: keras-preprocessing, pyyaml, keras-applications, keras
Successfully installed keras-2.2.4 keras-applications-1.0.8 keras-preprocessing-1.1.0 pyyaml-5.1.1
(wyd_dl) zutnlp@zutnlp:~$ pip uninstall keras && pip install keras==1.2.4
Uninstalling Keras-2.2.4:Would remove:/home/zutnlp/anaconda3/envs/wyd_dl/lib/python3.6/site-packages/Keras-2.2.4.dist-info/*/home/zutnlp/anaconda3/envs/wyd_dl/lib/python3.6/site-packages/docs/*/home/zutnlp/anaconda3/envs/wyd_dl/lib/python3.6/site-packages/keras/*
Proceed (y/n)? ySuccessfully uninstalled Keras-2.2.4
Collecting keras==1.2.4ERROR: Could not find a version that satisfies the requirement keras==1.2.4 (from versions: 0.2.0, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.1.0, 1.1.1, 1.1.2, 1.2.0, 1.2.1, 1.2.2, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4)
ERROR: No matching distribution found for keras==1.2.4
(wyd_dl) zutnlp@zutnlp:~$ pip uninstall keras && pip install keras==1.2.2
WARNING: Skipping keras as it is not installed.
Collecting keras==1.2.2Downloading https://files.pythonhosted.org/packages/75/3e/9926ce5c678b7a7978724a2ecf24857d89a415d152b8d3443e6d45c228b2/Keras-1.2.2.tar.gz (175kB)|████████████████████████████████| 184kB 27kB/s
Requirement already satisfied: theano in ./anaconda3/envs/wyd_dl/lib/python3.6/site-packages (from keras==1.2.2) (0.9.0)
Requirement already satisfied: pyyaml in ./anaconda3/envs/wyd_dl/lib/python3.6/site-packages (from keras==1.2.2) (5.1.1)
Requirement already satisfied: six in ./anaconda3/envs/wyd_dl/lib/python3.6/site-packages (from keras==1.2.2) (1.12.0)
Requirement already satisfied: numpy>=1.9.1 in ./anaconda3/envs/wyd_dl/lib/python3.6/site-packages (from theano->keras==1.2.2) (1.16.2)
Requirement already satisfied: scipy>=0.14 in ./anaconda3/envs/wyd_dl/lib/python3.6/site-packages (from theano->keras==1.2.2) (1.2.1)
Building wheels for collected packages: kerasBuilding wheel for keras (setup.py) ... doneStored in directory: /home/zutnlp/.cache/pip/wheels/55/07/cf/b32db0a8d243b2fd6759d5d7cb650aa20670b2b740209cbf7e
Successfully built keras
Installing collected packages: keras
Successfully installed keras-1.2.2
(wyd_dl) zutnlp@zutnlp:~$
Socket error Event: 32 Error: 10053.
Connection closing...Socket close.

reference:https://blog.csdn.net/SARACH_WONG/article/details/89328307

python中的常用命令相关推荐

  1. python中pip常用命令

    1.判断是否已安装pip: pip --version # Python2.x 版本命令 pip3 --version # Python3.x 版本命令 2.显示版本和路径:pip --version ...

  2. python os模块 常用命令

    os 模块用法示例 python编程时,经常和文件.目录打交道,这是就离不了os模块.os模块包含普遍的操作系统功能,与具体的平台无关.以下列举常用的命令 1. os.name()--判断现在正在实用 ...

  3. Python中的常用模块

    1.sys模块(内置模块) 在sys模块中定义了一些函数和变量,用来设置和获取系统的信息. # Python中的常用模块:sys模块 import sys sys.path.append('./tes ...

  4. python安装库常用命令

    python安装库常用命令 1.python库添加与查询 添加库的方法: 1.Windows+R打开运行,然后输入CMD进入命令提示符. 2.输入:where python .就会反馈出python安 ...

  5. python中执行linux命令(调用linux命令)_常见Python中调用Linux命令

    有时候我们需要从Python中执行Linux命令,下面就介绍几种方法? 1. os 模块: 1.1 os.system 函数: system方法会创建子进程运行外部程序,方法只返回外部程序的运行结果. ...

  6. python中执行linux命令(调用linux命令)_Python调用Linux bash命令

    import subprocess as sup  # 以下注释很多(为了自己以后不忘), 如果只是想在python中执行Linux命令, 看前5行就够了 # 3.5版本之后官方推荐使用sup.run ...

  7. python调用shell命令-在Python中执行shell命令的6种方法,你都知道吗?

    原标题:在Python中执行shell命令的6种方法,你都知道吗? Python经常被称作"胶水语言",因为它能够轻易地操作其他程序,轻易地包装使用其他语言编写的库.今天我们就讲解 ...

  8. python使用教程cmd啥意思-对python中执行DOS命令的3种方法总结

    1. 使用os.system("cmd") 特点是执行的时候程序会打出cmd在Linux上执行的信息. import os os.system("ls") 2. ...

  9. python调用shell命令-python中执行shell命令的几个方法小结

    最近有个需求就是页面上执行shell命令,第一想到的就是os.system, 复制代码 代码如下: os.system('cat /proc/cpuinfo') 但是发现页面上打印的命令执行结果 0或 ...

最新文章

  1. Redis 日志篇:无畏宕机实现高可用的杀手锏
  2. Android中Context简介(通俗易懂)
  3. Android SharedPreferences 详解 源码解析
  4. 搞明白这八个问题,Linux系统就好学多了
  5. Github+jsDelivr+PicGo 打造稳定快速、高效免费图床
  6. ubuntu mysql 二进制安装_ubuntu18.04手动安装二进制MySQL8.0
  7. 易优cms企业建站系统v1.5.1 含小程序源码
  8. 《Windows驱动开发技术详解》之HelloDDK
  9. mysql 优化 案例_[MySQL优化案例]系列 -- OPTIMIZE的威力
  10. 使用JMeter建立接口测试
  11. c++ static 关键字总结
  12. 阶段3 2.Spring_07.银行转账案例_5 编写业务层和持久层事务控制代码并配置spring的ioc...
  13. Rust : wasm尝试 与wasmtime库
  14. Java 基础知识 【钢镚核恒】
  15. vba_1《考勤表》
  16. 黑眼圈大神程序员用5000字带你通透读懂Elasticsearch的注意事项
  17. 解决Google浏览器打不开宝塔登录页面——阿里云服务器
  18. 【MATLAB】MATLAB 仿真模拟调制系统 — DSB 系统
  19. 2020牛客暑期多校训练营(第七场)J.Pointer Analysis
  20. 一文看尽 CVPR 2022 最新 20 篇 Oral 论文

热门文章

  1. 我的世界服务器支持多地图吗,我的世界:沉迷服务器地图有弊端,体验虽然很好,但很容易落伍!...
  2. GPIO模拟红外发射
  3. 摩尔纹的原理与产生条件(写的较好)
  4. Java基础(final关键字、双亲委派机制)
  5. 超详细 erlang服务器之微信公众号被动解析用户消息(明文模式安全模式)
  6. Google 的十大信条
  7. Cadence OrCAD Capture 软件自带元件原理图符号库目录与介绍图文视频教程
  8. 2020年大学毕业生就业前景如何?职业规划定位准确,并不是难事
  9. 高斯消元 AcWing 883. 高斯消元解线性方程组
  10. HTML5将给开发者带来什么?