您的位置:首页 > 其它

6月20日配置conda环境

2020-07-14 06:31 78 查看

项目conda环境的配置

先附上学习的博客
conda安装使用学习

  1. 安装好conda后直接activate环境时报了下面这个错误
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

$ conda init <SHELL_NAME>

后来查阅博客conda错误解决知道了是上次ssh连接该服务器使用conda activate python36命令激活环境后未使用conda deactivate退出环境就关闭终端导致的。最终通过这篇博客解决。
2. conda项目py环境的配置,项目使用的是python3.8
依赖如下:

name: innovationtraining
channels:
- defaults
dependencies:
- _r-mutex=1.0.0=anacondar_1
- attrs=19.3.0=py_0
- backcall=0.1.0=py38_0
- beautifulsoup4=4.9.1=py38_0
- bleach=3.1.4=py_0
- ca-certificates=2020.1.1=0
- certifi=2020.4.5.2=py38_0
- cffi=1.14.0=py38h7a1dbc1_0
- chardet=3.0.4=py38_1003
- click=7.1.2=py_0
- colorama=0.4.3=py_0
- cryptography=2.9.2=py38h7a1dbc1_0
- decorator=4.4.2=py_0
- defusedxml=0.6.0=py_0
- elasticsearch=7.0.4=py_0
- entrypoints=0.3=py38_0
- flask=1.1.2=py_0
- flask-sqlalchemy=2.4.1=py_0
- icu=58.2=ha925a31_3
- idna=2.9=py_1
- importlib-metadata=1.6.0=py38_0
- importlib_metadata=1.6.0=0
- ipykernel=5.1.4=py38h39e3cac_0
- ipython=7.13.0=py38h5ca1d4c_0
- ipython_genutils=0.2.0=py38_0
- ipywidgets=7.5.1=py_0
- itsdangerous=1.1.0=py_0
- jedi=0.17.0=py38_0
- jinja2=2.11.2=py_0
- jpeg=9b=hb83a4c4_2
- json5=0.9.5=py_0
- jsonschema=3.2.0=py38_0
- jupyter=1.0.0=py38_7
- jupyter_client=6.1.3=py_0
- jupyter_console=6.1.0=py_0
- jupyter_core=4.6.3=py38_0
- libpng=1.6.37=h2a8f88b_0
- libsodium=1.0.16=h9d3ae62_0
- m2w64-bwidget=1.9.10=2
- m2w64-bzip2=1.0.6=6
- m2w64-expat=2.1.1=2
- m2w64-fftw=3.3.4=6
- m2w64-flac=1.3.1=3
- m2w64-gcc-libgfortran=5.3.0=6
- m2w64-gcc-libs=5.3.0=7
- m2w64-gcc-libs-core=5.3.0=7
- m2w64-gettext=0.19.7=2
- m2w64-gmp=6.1.0=2
- m2w64-gsl=2.1=2
- m2w64-libiconv=1.14=6
- m2w64-libjpeg-turbo=1.4.2=3
- m2w64-libogg=1.3.2=3
- m2w64-libpng=1.6.21=2
- m2w64-libsndfile=1.0.26=2
- m2w64-libtiff=4.0.6=2
- m2w64-libvorbis=1.3.5=2
- m2w64-libwinpthread-git=5.0.0.4634.697f757=2
- m2w64-libxml2=2.9.3=4
- m2w64-mpfr=3.1.4=4
- m2w64-openblas=0.2.19=1
- m2w64-pcre=8.38=2
- m2w64-speex=1.2rc2=3
- m2w64-speexdsp=1.2rc3=3
- m2w64-tcl=8.6.5=3
- m2w64-tk=8.6.5=3
- m2w64-tktable=2.10=5
- m2w64-wineditline=2.101=5
- m2w64-xz=5.2.2=2
- m2w64-zlib=1.2.8=10
- markupsafe=1.1.1=py38he774522_0
- mistune=0.8.4=py38he774522_1000
- msys2-conda-epoch=20160418=1
- nbconvert=5.6.1=py38_0
- nbformat=5.0.6=py_0
- notebook=6.0.3=py38_0
- openssl=1.1.1g=he774522_0
- pandoc=2.2.3.2=0
- pandocfilters=1.4.2=py38_1
- parso=0.7.0=py_0
- pickleshare=0.7.5=py38_1000
- pip=20.0.2=py38_3
- prometheus_client=0.7.1=py_0
- prompt-toolkit=3.0.5=py_0
- prompt_toolkit=3.0.5=0
- pycparser=2.20=py_0
- pygments=2.6.1=py_0
- pymysql=0.9.2=py38_0
- pyopenssl=19.1.0=py38_0
- pyqt=5.9.2=py38ha925a31_4
- pyrsistent=0.16.0=py38he774522_0
- pysocks=1.7.1=py38_0
- python=3.8.3=he1778fa_0
- python-dateutil=2.8.1=py_0
- pywin32=227=py38he774522_1
- pywinpty=0.5.7=py38_0
- pyzmq=18.1.1=py38ha925a31_0
- qt=5.9.7=vc14h73c81de_0
- qtconsole=4.7.4=py_0
- qtpy=1.9.0=py_0
- r-base=3.6.1=hf18239d_1
- r-jiebard=0.1=r36h6115d3f_0
- requests=2.23.0=py38_0
- selenium=3.141.0=py38he774522_1000
- send2trash=1.5.0=py38_0
- setuptools=47.1.1=py38_0
- sip=4.19.13=py38ha925a31_0
- six=1.15.0=py_0
- soupsieve=2.0.1=py_0
- sqlalchemy=1.3.17=py38he774522_0
- sqlite=3.31.1=h2a8f88b_1
- terminado=0.8.3=py38_0
- testpath=0.4.4=py_0
- tornado=6.0.4=py38he774522_1
- traitlets=4.3.3=py38_0
- urllib3=1.25.8=py38_0
- vc=14.1=h0510ff6_4
- vs2015_runtime=14.16.27012=hf0eaf9b_2
- wcwidth=0.1.9=py_0
- webencodings=0.5.1=py38_1
- werkzeug=1.0.1=py_0
- wheel=0.34.2=py38_0
- widgetsnbextension=3.5.1=py38_0
- win_inet_pton=1.1.0=py38_0
- wincertstore=0.2=py38_0
- winpty=0.4.3=4
- zeromq=4.3.1=h33f27b4_3
- zipp=3.1.0=py_0
- zlib=1.2.11=h62dcd97_4
- pip:
- jieba==0.42.1
- simplejson==3.17.0
prefix: D:\mysoftware\Anaconda\envs\innovationtraining

直接使用依赖文件安装包的时候报了错误,一个一个安装的。
3. 使用

conda install package_name

安装python包时,有的python包,安装失败,显示

condainstallpydotFetchingpackagemetadata.......Solvingpackagespecifications:.PackageNotFoundError:Packagenotfound:''

查阅博客得知可以使用

anaconda search -t conda package_name

来查找到有对应库的源,然后安装,此处以jieba分词的包为例

(base) [admin@iZ2zeircp62xkpbg5hioetZ ~]$ conda search -t jieba3k
usage: conda [-h] [-V] command ...
conda: error: unrecognized arguments: -t
(base) [admin@iZ2zeircp62xkpbg5hioetZ ~]$ anaconda search -t conda jieba
Using Anaconda API: https://api.anaconda.org
Packages:
Name                      |  Version | Package Types   | Platforms       | Builds
------------------------- |   ------ | --------------- | --------------- | ----------
auto/jieba                |     0.32 | conda           | linux-64, linux-32 | py27_0
: http://github.com/fxsjy
conda-forge/jieba         |     0.39 | conda           | linux-64, win-32, osx-64, noarch, win-64 | py_1, py36_0, pyh9f0ad1d_1, py35_0, py27_0
: Chinese Words Segementation Utilities
conda-forge/jieba3k       |   0.35.1 | conda           | linux-64, win-32, osx-64, win-64, noarch | py36_1001, py36h9f0ad1d_1002, py37_1001, py38h32f6830_1002, py36_1, py37hc8dfbb8_1002, py36hc560c46_1002, py_0, py35_1001, py38_1001, py35_1
: Chinese Words Segementation Utilities
creditx/jieba             |     0.38 | conda           | linux-64        | py35_0, py27_0
hargup/jieba              |          | conda           | linux-64        | py27_0
: Chinese Words Segementation Utilities
iilab/jieba               |   0.36.2 | conda           | linux-64, osx-64 | py34_0
: Chinese Words Segementation Utilities
iilab/jieba3k             |   0.35.1 | conda           | linux-64, osx-64 | py34_0
: Chinese Words Segementation Utilities
jiangxiluning/jieba       |   0.36.2 | conda           | linux-64, osx-64, win-64 | py27_0
: Chinese Words Segementation Utilities
moustik/jieba             |     0.38 | conda           | linux-64        | py27_0
r/r-jiebard               |      0.1 | conda           | noarch          | r36h6115d3f_0
: jiebaR is a package for Chinese text segmentation, keyword extraction and speech tagging. This package provides the data files required by jiebaR.
r_test/r-jiebard          |      0.1 | conda           | noarch          | r36h6115d3f_0
: jiebaR is a package for Chinese text segmentation, keyword extraction and speech tagging. This package provides the data files required by jiebaR.
syllabs_admin/jieba       |     0.39 | conda           | linux-64        | py27ha286e51_0
Found 12 packages

Run 'anaconda show <USER/PACKAGE>' to get installation details
(base) [admin@iZ2zeircp62xkpbg5hioetZ ~]$ conda install -c https://conda.anaconda.org/conda-forge jieba3k
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: