conda

Anaconda 管理Python环境(安装、激活、更新、删除)

二次信任 提交于 2020-05-08 21:13:52
由于不同的项目需要用不同的python版本,于是使用Anaconda来进行版本管理,现记录一下经验: 在官网下载并安装好Anaconda以后(非常简单,此处不赘述): 1. 查看Python环境 conda info --env可以看到所有python环境,前面有个‘*’的代表当前环境: 2.创建Python环境 conda create --name python35 python=3.5 代表创建一个python3.5的环境,我们把它命名为python35 2.创建Python环境 conda create --name python35 python=3.5 代表创建一个python3.5的环境,我们把它命名为python35 3.管理和使用python环境 使用conda activate python35 来激活刚才创建的环境: 尝试使用pip install numpy来给这个环境安装一个常用的包: 当然也可以用conda install numpy来安装,但是会同时安装很多相关的包,在此就不演示了。 在简单的熟悉了以后,就会发现用anaconda来进行python环境的控制真的是非常方便,其实anaconda环境是有物理路径的,如下,你会发现这和我们之前conda info --env的list是一样的: 之后我们删除python35 : conda remove

anaconda + VSCode + 生产环境配置

岁酱吖の 提交于 2020-05-08 21:13:10
1. 修改jupyter notebook 默认路径: 进入anaconda 命令行, jupyter notebook - - generate - config 生成配置文件, 该文件在 本机用户名/.jupyter 下。 进入jupyter_notebook_config.py 找到 ## The directory to use for notebooks and kernels. c.NotebookApp.notebook_dir = 'C:\Users\33488\Documents' 2. 添加国内资源镜像 #清华 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ # 设置搜索时显示通道地址 conda config --set show_channel_urls yes # 中科大 conda

Spyder failed to launch in Anaconda after update (4.1.2)

折月煮酒 提交于 2020-05-08 18:53:09
问题 I have just updated Spyder to 4.1.2 and when I try to launch it, it now produces an error and fails to launch. Output from conda list pylint How can I solve this? Error: Traceback (most recent call last): File "/Users/name/opt/anaconda3/bin/spyder", line 11, in sys.exit(main()) File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/spyder/app/start.py", line 205, in main mainwindow.main() File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 3734, in

Spyder failed to launch in Anaconda after update (4.1.2)

两盒软妹~` 提交于 2020-05-08 18:51:58
问题 I have just updated Spyder to 4.1.2 and when I try to launch it, it now produces an error and fails to launch. Output from conda list pylint How can I solve this? Error: Traceback (most recent call last): File "/Users/name/opt/anaconda3/bin/spyder", line 11, in sys.exit(main()) File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/spyder/app/start.py", line 205, in main mainwindow.main() File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 3734, in

Anaconda使用conda activate激活环境报错Your shell has not been properly configured to use 'conda activate'.

烈酒焚心 提交于 2020-05-08 13:55:40
在vs code下打开终端会报错Your shell has not been properly configured to use 'conda activate'. 解决方法: 1、激活环境 # 激活环境 source activate 2、退出环境 conda deactivate 3、激活base conda activate base h好像这个办法只能短暂的解决问题,再打开还是会出现,最后从anaconda navigator界面卸载vs code再安装就没问题了...... 来源: oschina 链接: https://my.oschina.net/u/4412579/blog/4270268

【CV学习1】opencv-python:第一,二章

限于喜欢 提交于 2020-05-08 08:28:22
第一章 Introduction   OpenCV     Opencv现在支持多种与计算机视觉和机器学习相关的算法   OpenCV-Python     它是由C/C++写的Py的封装器,优点:       1,运行速度与原始的c/c++一样快(本质是c/c++写的)       2,用py写代码比c/c++方便 第二章 Install OpenCV-Python in Windows   0. 引言     对于opencv-python的安装并不友好,前前后后大概捣鼓了2-3天,总结原因就是对于opencv-python不要用太新版的whl   1. 目标     在Anaconda的虚拟环境中安装OpenCV-Python及其相关组件   2. 安装环境     Windows 7 64位操作系统     Anaconda: Anaconda3-5.2.0-Windows-x86_64(对应于Python 3.6)     OpenCV-Python: opencv_python-3.3.1-cp36-cp36m-win_amd64.whl     (ps:如果想用SIFT,SURF等的,可以直接pip install opencv-contrib-python==3.3.1.11)     Dlib: dlib-19.7.0-cp36-cp36m-win_amd64

python gdal安装与简单使用

白昼怎懂夜的黑 提交于 2020-05-07 19:43:35
原文链接: python gdal安装与简单使用 gdal安装 方式一:在网址 https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal 下载对应python版本的whl文件,在命令行中pip install whl文件完整路径安装(windows方式)。 方式二: 命令行conda/pip search gdal查看版本,选择合适的版本(我的2.2.4),如果没有,使用方式一。 命令行conda/pip install gdal=版本号,注意加上版本号,否则可能安装上老版本(windows/linux都可用)。 其他:centos 编译、配置 gdal 测试 gdal包用于处理栅格数据,ogr用于处理矢量数据。 以下程序为gdal处理栅格的简单应用。 1 from osgeo import gdal 2 import numpy as np 3 np.set_printoptions(threshold=np.inf) # 使print大量数据不用符号...代替而显示所有 4 5 dataset = gdal.Open( " E:/RS_data/caijian1214/caijian.tif " ) 6 7 print (dataset.GetDescription()) # 数据描述 8 9 print (dataset

Faiss in python and GPU报错:NotImplementedError: Wrong number or type of arguments for overloaded f...

末鹿安然 提交于 2020-05-07 18:37:59
最近在玩faiss,运行这段代码的时候报错了: res = faiss.StandardGpuResources() flat_config = 0 index = faiss.GpuIndexFlatL2(res,d,flat_config) 报错内容见上: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "swigfaiss_gpu.py", line 2958, in __init__ this = _swigfaiss_gpu.new_GpuIndexFlatL2(*args) NotImplementedError: Wrong number or type of arguments for overloaded function 'new_GpuIndexFlatL2'. Possible C/C++ prototypes are: faiss::gpu::GpuIndexFlatL2::GpuIndexFlatL2(faiss::gpu::GpuResources *,faiss::IndexFlatL2 *,faiss::gpu::GpuIndexFlatConfig) faiss::gpu::GpuIndexFlatL2::GpuIndexFlatL2

深度学习环境搭建:window10+CUDA10.0+CUDNN+pytorch1.2.0

流过昼夜 提交于 2020-05-07 08:53:40
去年底入手一台联想Y7000P,配置了Nvidia GeForce GTX 1660 Ti GPU,GPU内存6G,但是因为有GPU服务器,所以一直没有在这台笔记本上跑过模型,如今经过一番折腾,终于在此笔记本上搭建好了环境,并成功使用GPU训练了一些模型,本篇记录了环境搭建的过程。 检查你的GPU 首先确保你的电脑有Nvidia的GPU,并且支持CUDA,可以参考 这个网址 。 安装vs2017 Visual Studio 2017 Community下载地址 安装选项:勾选“C++的桌面开发”,右边的列表再额外勾选一个SDK,这个SDK是在后续测试CUDA样例的时候要用到的,如下图: 安装CUDA10.0 下载 打开网站: CUDA10.0 按照下图选择对应的选项后,点击下载: 安装 双击下载的文件,选择自定义安装,如果之前你已经安装过显卡驱动并且兼容CUDA10.0,可以在这里去掉显卡驱动的勾选,兼容情况参考 这里 ,截图如下: 另外,去掉Visual studio integration的勾选: 后面默认选择下一步,等待安装完成。 测试 命令行测试: nvcc -V 输出以下信息即成功: 样例测试: 以管理员方式打开vs2017,然后加载bandwidthTest解决方案,路径如下: C:\ProgramData\NVIDIA Corporation\CUDA Samples

如何为python 2.7安装tensorflow?

谁都会走 提交于 2020-05-06 00:11:42
“TensorFlow在Windows上支持Python 3.5.x和3.6.x.” 因此,您无法在Windows上使用Python 2.7的tensorflow 如果您被迫使用Python 2.7,则使用虚拟机框将Linux设置为guest虚拟机。 如果您可以选择使用python 3.x(例如python 3.6),您可以使用python 3.6安装anaconda。 https://repo.anaconda.com/archive/Anaconda3-5.1.0-Windows-x86_64.exe 如果你有一个带有python 2.7的anaconda你可以定义一个environment.yml然后创建conda env https://conda.io/docs/user-guide/tasks/manage-environments.html#creating-an-environment-from-an -environment-yml-file https://conda.io/docs/user-guide/tasks/manage-environments.html#create-env-file-manually 可能是因为使用Python 2.7你无法创建一个Python 3.x环境。 试试看。 一旦你有一个使用Python 3.6的Anaconda就可以了