conda
查看conda环境:conda env list
新建conda环境(env_name就是创建的环境名,可以自定义):conda create -n env_name
激活conda环境(ubuntu与Macos 将conda 替换为source):conda activate env_name
退出conda环境:conda deactivate
安装和卸载python包:conda install numpy # conda uninstall numpy
查看已安装python列表:conda list -n env_name
不激活base
conda config --set auto_activate_base false
国内源:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
例如:
conda create -n TF_2C python=3.7
conda activate TF_2C
sudo pip install opencv-python
下载地址
https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/
Jupyter环境
conda install notebook ipykernel
jupyter notebook 启动
jupyter notebook --no-browser --port 8888 --ip=0.0.0.0
l 生成一个 notebook 配置文件
默认情况下,配置文件 ~/.jupyter/jupyter_notebook_config.py 并不存在,需要自行创建。使用下列命令生成配置文件:
jupyter notebook --generate-config
l 生成密码
自动生成
从 jupyter notebook 5.0 版本开始,提供了一个命令来设置密码:jupyter notebook password,生成的密码存储在 jupyter_notebook_config.json。
$ jupyter notebook password
Enter password: ****
Verify password: ****
l 修改配置文件
在 jupyter_notebook_config.py 中找到下面的行,取消注释并修改。
c.NotebookApp.ip='*' #在所有的网卡接口上开启服务
c.NotebookApp.port =8888 #可自行指定一个端口, 访问时使用该端口1234
c.NotebookApp.allow_remote_access = True #允许远程
TF2.0
conda activate TF_2C
pip install tensorflow==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
import tensorflow as tf version = tf.__version__ gpu_ok = tf.test.is_gpu_available print("tf version:",version,"\n use GPU",gpu_ok)
相关文章
- conda
- 成功解决CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.If u
- 成功解决CondaError: Error reading file, file should be a text file containing packages conda create --he
- 成功解决ProxyError: Conda cannot proceed due to an error in your proxy configuration.Check for typos an
- 成功解决CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate‘.If u
- conda 安装yaml环境中的各种坑
- 使用conda创建环境以及出现包找不到解决方案
- jupyter notebook 加入conda虚拟环境(指定conda虚拟环境)
- 完美解決conda创建虚拟环境时报错:NotWritableError: =...required path的問題
- conda入门到精通
- 04 conda 安装失败 conda很慢 conda安装很慢 centos7.9系统中Linux系统
- 单细胞流程 安装conda 下载基因组数据 然后走cellranger 流程得到10x数据 学校服务器集群anaconda安装
- pip和conda的区别【转载】
- conda搭建工作环境