linux centos新机器容器中创建虚拟环境
新机器创建虚拟环境
conda已安装
创建并进入虚拟环境
conda create -n py39_syn python=3.9
conda activate py39_syn, 激活失败,提示(To initialize your shell,$ conda init <SHELL_NAME>, IMPORTANT: You may need to close and restart your shell after running ‘conda init’.),解决办法:1、确定您当前使用的shell名称,可以通过以下方法之一来查看:1)echo $SHELL;2)ps -p $$;(我使用的是bash)2、 conda init <SHELL_NAME> 即 conda init bash
,运行此命令后,您可能需要关闭当前的终端窗口,并重新打开一个新的终端窗口,以使更改生效。–》conda activate py39_syn 成功进入指定虚拟环境。
安装python依赖包
安装指定包:https://blog.csdn.net/woomay/article/details/143493552?sharetype=blogdetail&sharerId=143493552&sharerefer=PC&sharesource=woomay&spm=1011.2480.3001.8118, 安装annoy异常:pip install annoy==1.17.3
----》异常1(Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try pip install --use-pep517
.)–》pip install --use-pep517 annoy==1.17.3
----》异常2:g++: error: unrecognized command line option ‘-std=c++14’,当前系统版本# g++ --version
g++ (GCC) 4.8.5,尝试更新至g++ (GCC) 6.3.0版本(具体操作:安装sudo命令 yum install sudo,root账户不需要sudo,。,求助其他人。。conda install annoy
–》有提示!!https://anaconda.org/search?q=annoy,https://anaconda.org/conda-forge/python-annoy,最终解决命令conda install conda-forge::python-annoy
)
jupyter notebook指定虚拟环境
https://blog.csdn.net/woomay/article/details/137050311?ops_request_misc=%257B%2522request%255Fid%2522%253A%25228B7C1FCF-B8B5-4D19-A3E2-5EB45CF5671E%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=8B7C1FCF-B8B5-4D19-A3E2-5EB45CF5671E&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2blogfirst_rank_ecpm_v1~rank_v31_ecpm-1-137050311-null-null.nonecase&utm_term=jupyter%20notebook%E6%8C%87%E5%AE%9A%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83&spm=1018.2226.3001.4450