anaconda虚拟环境常用操作

12 篇文章 1 订阅

在刚接触到服务器的时候,使用服务器的过程中会遇到各种各样的问题。

由于服务器是公用的,可以在服务器上安装anaconda,anaconda可以搭建环境,还可以创建属于自己的虚拟环境。

使用命令 top,即可查看当前的服务器使用状态,如果CPU的使用率超过80%,就不要跑程序了。

退出Ctrl+C。

一、创建虚拟环境相关操作

下面是一些anaconda的一些常用操作:

1、首先,根据服务器的IP、用户名以及密码登录访问服务器;可以通过Xmanager进行访问、连接、传输文件,非常方便;

登录后如下图,系统已安装好anaconda:

2、在服务器系统中安装anaconda,可以打开命令行输入conda -V检验是否安装以及当前conda的版本。

3、conda常用的命令

    1)conda list查看安装了哪些包

    2)conda env list或 conda info -e 查看当前存在哪些虚拟环境

    3)conda update conda 检查更新当前conda

在Anaconda配置添加清华镜像:

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 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

 

4、创建python虚拟环境

conda create -n env_name python=3.6    其中env_name是自己虚拟环境的名称,可任意命名

同时安装必要的包:

conda create -n env_name numpy matplotlib python=3.6

env_name文件可以在Anaconda安装目录envs文件下找到,使用conda env list命令即可看到下图现有哪些虚拟环境:

5、在虚拟环境中安装额外的包

 使用命令conda install -n env_name [package]即可安装package到your_env_name中

比如要在名为env_name的虚拟环境中安装pyltp,就可以使用命令:conda install -n env_name pyltp

6、激活虚拟环境

使用如下命令即可激活创建的虚拟环境

#Linux

source activate your_env_name(虚拟环境名称)

#Windows

activate your_env_name(虚拟环境名称)

此时使用python --version可以检查当前python版本是否为想要的(即虚拟环境的python版本)

7、退出虚拟环境

 

使用如下命令即可退出创建的虚拟环境

#Linux

source deactivate your_env_name(虚拟环境名称)

#Windows

deactivate your_env_name(虚拟环境名称)

 

8、删除虚拟环境

#删除环境

conda remove -n your_env_name(虚拟环境名称) --all

#使用命令

conda remove --name $your_env_name  $package_name(包名)

 

在Pycharm中使用虚拟环境

首先查看当前存在的虚拟环境:~$conda env list

在Pycharm中选择:File->setting->Project:XXXX->Project Interperter

可以新建一个,也可以选择上面所创建的虚拟环境。

选择虚拟环境中bin目录下python3.X即可。

 

二、程序文件传输到服务器

用Xmanager中的Xftp进行传输。首先需在Xftp中新建一个Xftp会话(需输入服务器地址、用户名、密码)进行连接,连接上直接将本地文件拖拽到自己在服务器上建的文件夹即可。

直接从本地(左侧)拖拽文件到服务器(右侧)指定文件夹下:

查看项目树形结构:

 

三、linux常用命令:

anaconda用法:
查看已经安装的包:
pip list 或者 conda list

安装和更新:
pip install requests
pip install requests –upgrade
或者
conda install requests
conda update requests
sudo password root或者su root   获取root权限

cd /home或者cd /文件夹名  进入某一个文件夹

cd ..  返回上一级文件夹

sudo mkdir 文件夹名   创建新的文件夹

mv 文件夹名 /usr/java/   移动文件夹

tar -xzvf 文件名    解压文件夹

sudo gedit ~/.bashrc   修改配置文件

chmod a+w 文件名    修改只读文件改为读写

ifconfig -a   查看IP

rm ./*   删除某文件夹下的全部文件

unzip 文件名   解压zip文件

 

四、进入jupyter notebook环境,打开ipthon文件

首先进入虚拟环境中:conda activate tf2.0

再进入.ipython文件所在的目录,并输入 jupyter notebook命令即可

随即打开所需打开的界面:

这样就不会弄混弄乱了。

cmd中具体步骤详情:


(base) C:\Users\Awen>conda list
# packages in environment at D:\Anaconda3:
#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0            py36he6757f0_0    defaults
alabaster                 0.7.10           py36hcd07829_0    defaults
anaconda                  5.2.0                    py36_3    defaults
anaconda-client           1.6.14                   py36_0    defaults
anaconda-navigator        1.8.7                    py36_0    defaults
anaconda-project          0.8.2            py36hfad2e28_0    defaults
asn1crypto                0.24.0                   py36_0    defaults
astroid                   1.6.3                    py36_0    defaults
astropy                   3.0.2            py36h452e1ab_1    defaults
attrs                     18.1.0                   py36_0    defaults
babel                     2.5.3                    py36_0    defaults
backcall                  0.1.0                    py36_0    defaults
backports                 1.0              py36h81696a8_1    defaults
backports.shutil_get_terminal_size 1.0.0            py36h79ab834_2    defaults
beautifulsoup4            4.6.0            py36hd4cc5e8_1    defaults
bitarray                  0.8.1            py36hfa6e2cd_1    defaults
bkcharts                  0.2              py36h7e685f7_0    defaults
blas                      1.0                         mkl    defaults
blaze                     0.11.3           py36h8a29ca5_0    defaults
bleach                    2.1.3                    py36_0    defaults
blosc                     1.14.3               he51fdeb_0    defaults
bokeh                     0.12.16                  py36_0    defaults
boto                      2.48.0           py36h1a776d2_1    defaults
bottleneck                1.2.1            py36hd119dfa_0    defaults
bzip2                     1.0.6                hfa6e2cd_5    defaults
ca-certificates           2018.03.07                    0    defaults
certifi                   2018.4.16                py36_0    defaults
cffi                      1.11.5           py36h945400d_0    defaults
chardet                   3.0.4            py36h420ce6e_1    defaults
click                     6.7              py36hec8c647_0    defaults
cloudpickle               0.5.3                    py36_0    defaults
clyent                    1.2.2            py36hb10d595_1    defaults
colorama                  0.3.9            py36h029ae33_0    defaults
comtypes                  1.1.4                    py36_0    defaults
conda                     4.5.4                    py36_0    defaults
conda-build               3.10.5                   py36_0    defaults
conda-env                 2.6.0                h36134e3_1    defaults
conda-verify              2.0.0            py36h065de53_0    defaults
console_shortcut          0.1.1                h6bb2dd7_3    defaults
contextlib2               0.5.5            py36he5d52c0_0    defaults
cryptography              2.2.2            py36hfa6e2cd_0    defaults
curl                      7.60.0               h7602738_0    defaults
cycler                    0.10.0           py36h009560c_0    defaults
cython                    0.28.2           py36hfa6e2cd_0    defaults
cytoolz                   0.9.0.1          py36hfa6e2cd_0    defaults
dask                      0.17.5                   py36_0    defaults
dask-core                 0.17.5                   py36_0    defaults
datashape                 0.5.4            py36h5770b85_0    defaults
decorator                 4.3.0                    py36_0    defaults
distributed               1.21.8                   py36_0    defaults
docutils                  0.14             py36h6012d8f_0    defaults
entrypoints               0.2.3            py36hfd66bb0_2    defaults
et_xmlfile                1.0.1            py36h3d2d736_0    defaults
fastcache                 1.0.2            py36hfa6e2cd_2    defaults
filelock                  3.0.4                    py36_0    defaults
flask                     1.0.2                    py36_1    defaults
flask-cors                3.0.4                    py36_0    defaults
freetype                  2.8                  h51f8f2c_1    defaults
get_terminal_size         1.0.0                h38e98db_0    defaults
gevent                    1.3.0            py36hfa6e2cd_0    defaults
glob2                     0.6              py36hdf76b57_0    defaults
greenlet                  0.4.13           py36hfa6e2cd_0    defaults
h5py                      2.7.1            py36h3bdd7fb_2    defaults
hdf5                      1.10.2               hac2f561_1    defaults
heapdict                  1.0.0                    py36_2    defaults
html5lib                  1.0.1            py36h047fa9f_0    defaults
icc_rt                    2017.0.4             h97af966_0    defaults
icu                       58.2                 ha66f8fd_1    defaults
idna                      2.6              py36h148d497_1    defaults
imageio                   2.3.0                    py36_0    defaults
imagesize                 1.0.0                    py36_0    defaults
intel-openmp              2018.0.0                      8    defaults
ipykernel                 4.8.2                    py36_0    defaults
ipython                   6.4.0                    py36_0    defaults
ipython_genutils          0.2.0            py36h3c5d0ee_0    defaults
ipywidgets                7.2.1                    py36_0    defaults
isort                     4.3.4                    py36_0    defaults
itsdangerous              0.24             py36hb6c5a24_1    defaults
jdcal                     1.4                      py36_0    defaults
jedi                      0.12.0                   py36_1    defaults
jinja2                    2.10             py36h292fed1_0    defaults
jpeg                      9b                   hb83a4c4_2    defaults
jsonschema                2.6.0            py36h7636477_0    defaults
jupyter                   1.0.0                    py36_4    defaults
jupyter_client            5.2.3                    py36_0    defaults
jupyter_console           5.2.0            py36h6d89b47_1    defaults
jupyter_core              4.4.0            py36h56e9d50_0    defaults
jupyterlab                0.32.1                   py36_0    defaults
jupyterlab_launcher       0.10.5                   py36_0    defaults
kiwisolver                1.0.1            py36h12c3424_0    defaults
lazy-object-proxy         1.3.1            py36hd1c21d2_0    defaults
libcurl                   7.60.0               hc4dcbb0_0    defaults
libiconv                  1.15                 h1df5818_7    defaults
libpng                    1.6.34               h79bbb47_0    defaults
libsodium                 1.0.16               h9d3ae62_0    defaults
libssh2                   1.8.0                hd619d38_4    defaults
libtiff                   4.0.9                hb8ad9f9_1    defaults
libxml2                   2.9.8                hadb2253_1    defaults
libxslt                   1.1.32               hf6f1972_0    defaults
llvmlite                  0.23.1           py36hcacf6c6_0    defaults
locket                    0.2.0            py36hfed976d_1    defaults
lxml                      4.2.1            py36heafd4d3_0    defaults
lzo                       2.10                 h6df0209_2    defaults
m2w64-gcc-libgfortran     5.3.0                         6    defaults
m2w64-gcc-libs            5.3.0                         7    defaults
m2w64-gcc-libs-core       5.3.0                         7    defaults
m2w64-gmp                 6.1.0                         2    defaults
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    defaults
markupsafe                1.0              py36h0e26971_1    defaults
matplotlib                2.2.2            py36h153e9ff_1    defaults
mccabe                    0.6.1            py36hb41005a_1    defaults
menuinst                  1.4.14           py36hfa6e2cd_0    defaults
mistune                   0.8.3            py36hfa6e2cd_1    defaults
mkl                       2018.0.2                      1    defaults
mkl-service               1.1.2            py36h57e144c_4    defaults
mkl_fft                   1.0.1            py36h452e1ab_0    defaults
mkl_random                1.0.1            py36h9258bd6_0    defaults
more-itertools            4.1.0                    py36_0    defaults
mpmath                    1.0.0            py36hacc8adf_2    defaults
msgpack-python            0.5.6            py36he980bc4_0    defaults
msys2-conda-epoch         20160418                      1    defaults
multipledispatch          0.5.0                    py36_0    defaults
navigator-updater         0.2.1                    py36_0    defaults
nbconvert                 5.3.1            py36h8dc0fde_0    defaults
nbformat                  4.4.0            py36h3a5bc1b_0    defaults
networkx                  2.1                      py36_0    defaults
nltk                      3.3.0                    py36_0    defaults
nose                      1.3.7            py36h1c3779e_2    defaults
notebook                  5.5.0                    py36_0    defaults
numba                     0.38.0           py36h830ac7b_0    defaults
numexpr                   2.6.5            py36hcd2f87e_0    defaults
numpy                     1.14.3           py36h9fa60d3_1    defaults
numpy-base                1.14.3           py36h555522e_1    defaults
numpydoc                  0.8.0                    py36_0    defaults
odo                       0.5.1            py36h7560279_0    defaults
olefile                   0.45.1                   py36_0    defaults
openpyxl                  2.5.3                    py36_0    defaults
openssl                   1.0.2o               h8ea7d77_0    defaults
packaging                 17.1                     py36_0    defaults
pandas                    0.23.0           py36h830ac7b_0    defaults
pandoc                    1.19.2.1             hb2460c7_1    defaults
pandocfilters             1.4.2            py36h3ef6317_1    defaults
parso                     0.2.0                    py36_0    defaults
partd                     0.3.8            py36hc8e763b_0    defaults
path.py                   11.0.1                   py36_0    defaults
pathlib2                  2.3.2                    py36_0    defaults
patsy                     0.5.0                    py36_0    defaults
pep8                      1.7.1                    py36_0    defaults
pickleshare               0.7.4            py36h9de030f_0    defaults
pillow                    5.1.0            py36h0738816_0    defaults
pip                       10.0.1                   py36_0    defaults
pkginfo                   1.4.2                    py36_1    defaults
pluggy                    0.6.0            py36hc7daf1e_0    defaults
ply                       3.11                     py36_0    defaults
prompt_toolkit            1.0.15           py36h60b8f86_0    defaults
psutil                    5.4.5            py36hfa6e2cd_0    defaults
py                        1.5.3                    py36_0    defaults
pycodestyle               2.4.0                    py36_0    defaults
pycosat                   0.6.3            py36h413d8a4_0    defaults
pycparser                 2.18             py36hd053e01_1    defaults
pycrypto                  2.6.1            py36hfa6e2cd_8    defaults
pycurl                    7.43.0.1         py36h74b6da3_0    defaults
pyflakes                  1.6.0            py36h0b975d6_0    defaults
pygments                  2.2.0            py36hb010967_0    defaults
pylint                    1.8.4                    py36_0    defaults
pyodbc                    4.0.23           py36h6538335_0    defaults
pyopenssl                 18.0.0                   py36_0    defaults
pyparsing                 2.2.0            py36h785a196_1    defaults
pyqt                      5.9.2            py36h1aa27d4_0    defaults
pysocks                   1.6.8                    py36_0    defaults
pytables                  3.4.3            py36he6f6034_1    defaults
pytest                    3.5.1                    py36_0    defaults
pytest-arraydiff          0.2                      py36_0    defaults
pytest-astropy            0.3.0                    py36_0    defaults
pytest-doctestplus        0.1.3                    py36_0    defaults
pytest-openfiles          0.3.0                    py36_0    defaults
pytest-remotedata         0.2.1                    py36_0    defaults
python                    3.6.5                h0c2934d_0    defaults
python-dateutil           2.7.3                    py36_0    defaults
pytz                      2018.4                   py36_0    defaults
pywavelets                0.5.2            py36hc649158_0    defaults
pywin32                   223              py36hfa6e2cd_1    defaults
pywinpty                  0.5.1                    py36_0    defaults
pyyaml                    3.12             py36h1d1928f_1    defaults
pyzmq                     17.0.0           py36hfa6e2cd_1    defaults
qt                        5.9.5            vc14he4a7d60_0  [vc14]  defaults
qtawesome                 0.4.4            py36h5aa48f6_0    defaults
qtconsole                 4.3.1            py36h99a29a9_0    defaults
qtpy                      1.4.1                    py36_0    defaults
requests                  2.18.4           py36h4371aae_1    defaults
rope                      0.10.7           py36had63a69_0    defaults
ruamel_yaml               0.15.35          py36hfa6e2cd_1    defaults
scikit-image              0.13.1           py36hfa6e2cd_1    defaults
scikit-learn              0.19.1           py36h53aea1b_0    defaults
scipy                     1.1.0            py36h672f292_0    defaults
seaborn                   0.8.1            py36h9b69545_0    defaults
send2trash                1.5.0                    py36_0    defaults
setuptools                39.1.0                   py36_0    defaults
simplegeneric             0.8.1                    py36_2    defaults
singledispatch            3.4.0.3          py36h17d0c80_0    defaults
sip                       4.19.8           py36h6538335_0    defaults
six                       1.11.0           py36h4db2310_1    defaults
snappy                    1.1.7                h777316e_3    defaults
snowballstemmer           1.2.1            py36h763602f_0    defaults
sortedcollections         0.6.1                    py36_0    defaults
sortedcontainers          1.5.10                   py36_0    defaults
sphinx                    1.7.4                    py36_0    defaults
sphinxcontrib             1.0              py36hbbac3d2_1    defaults
sphinxcontrib-websupport  1.0.1            py36hb5e5916_1    defaults
spyder                    3.2.8                    py36_0    defaults
sqlalchemy                1.2.7            py36ha85dd04_0    defaults
sqlite                    3.23.1               h35aae40_0    defaults
statsmodels               0.9.0            py36h452e1ab_0    defaults
sympy                     1.1.1            py36h96708e0_0    defaults
tblib                     1.3.2            py36h30f5020_0    defaults
terminado                 0.8.1                    py36_1    defaults
testpath                  0.3.1            py36h2698cfe_0    defaults
tk                        8.6.7                hcb92d03_3    defaults
toolz                     0.9.0                    py36_0    defaults
tornado                   5.0.2                    py36_0    defaults
traitlets                 4.3.2            py36h096827d_0    defaults
typing                    3.6.4                    py36_0    defaults
unicodecsv                0.14.1           py36h6450c06_0    defaults
urllib3                   1.22             py36h276f60a_0    defaults
vc                        14                   h0510ff6_3    defaults
vs2015_runtime            14.0.25123                    3    defaults
wcwidth                   0.1.7            py36h3d5aa90_0    defaults
webencodings              0.5.1            py36h67c50ae_1    defaults
werkzeug                  0.14.1                   py36_0    defaults
wheel                     0.31.1                   py36_0    defaults
widgetsnbextension        3.2.1                    py36_0    defaults
win_inet_pton             1.0.1            py36he67d7fd_1    defaults
win_unicode_console       0.5              py36hcdbd4b5_0    defaults
wincertstore              0.2              py36h7fe50ca_0    defaults
winpty                    0.4.3                         4    defaults
wrapt                     1.10.11          py36he5f5981_0    defaults
xlrd                      1.1.0            py36h1cb58dc_1    defaults
xlsxwriter                1.0.4                    py36_0    defaults
xlwings                   0.11.8                   py36_0    defaults
xlwt                      1.3.0            py36h1a4751e_0    defaults
yaml                      0.1.7                hc54c509_2    defaults
zeromq                    4.2.5                hc6251cf_0    defaults
zict                      0.1.3            py36h2d8e73e_0    defaults
zlib                      1.2.11               h8395fce_2    defaults

(base) C:\Users\Awen>
(base) C:\Users\Awen>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
Warning: 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' already in 'channels' list, moving to the top

(base) C:\Users\Awen>
(base) C:\Users\Awen>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

(base) C:\Users\Awen>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
Warning: 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' already in 'channels' list, moving to the top

(base) C:\Users\Awen>
(base) C:\Users\Awen>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
Warning: 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/' already in 'channels' list, moving to the top

(base) C:\Users\Awen>
(base) C:\Users\Awen>conda config --set show_channel_urls yes

(base) C:\Users\Awen>conda env list
# conda environments:
#
base                  *  D:\Anaconda3


(base) C:\Users\Awen>conda create -n tf2.0 python=3.6.5
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.4
  latest version: 4.8.3

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: D:\Anaconda3\envs\tf2.0

  added / updated specs:
    - python=3.6.5


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pip-9.0.1                  |           py36_1         1.7 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    wincertstore-0.2           |           py36_0          14 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    python-3.6.5               |                1        19.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    vc-14                      |                0          703 B  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    setuptools-36.4.0          |           py36_1         534 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    vs2015_runtime-14.0.25420  |                0         2.0 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    certifi-2016.2.28          |           py36_0         214 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    wheel-0.29.0               |           py36_0         129 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    ------------------------------------------------------------
                                           Total:        24.0 MB

The following NEW packages will be INSTALLED:

    certifi:        2016.2.28-py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    pip:            9.0.1-py36_1     https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    python:         3.6.5-1          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    setuptools:     36.4.0-py36_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    vc:             14-0             https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    vs2015_runtime: 14.0.25420-0     https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    wheel:          0.29.0-py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    wincertstore:   0.2-py36_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

Proceed ([y]/n)? y


Downloading and Extracting Packages
pip-9.0.1            |  1.7 MB | ############################################################################## | 100%
wincertstore-0.2     |   14 KB | ############################################################################## | 100%
python-3.6.5         | 19.5 MB | ############################################################################## | 100%
vc-14                |   703 B | ############################################################################## | 100%
setuptools-36.4.0    |  534 KB | ############################################################################## | 100%
vs2015_runtime-14.0. |  2.0 MB | ############################################################################## | 100%
certifi-2016.2.28    |  214 KB | ############################################################################## | 100%
wheel-0.29.0         |  129 KB | ############################################################################## | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate tf2.0
#
# To deactivate an active environment, use
#
#     $ conda deactivate


(base) C:\Users\Awen>conda env list
# conda environments:
#
base                  *  D:\Anaconda3
tf2.0                    D:\Anaconda3\envs\tf2.0


(base) C:\Users\Awen>conda activate tf2.0

(tf2.0) C:\Users\Awen>conda install tensorflow==2.0
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.4
  latest version: 4.8.3

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: D:\Anaconda3\envs\tf2.0

  added / updated specs:
    - tensorflow==2.0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2020.4.5.1         |   py36h9f0ad1d_0         151 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    m2w64-libwinpthread-git-5.0.0.4634.697f757|                2          30 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    openssl-1.1.1f             |       hfa6e2cd_0         4.7 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    keras-preprocessing-1.1.0  |             py_0          33 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    wrapt-1.12.1               |   py36h68a101e_1          44 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libblas-3.8.0              |           14_mkl         3.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    six-1.14.0                 |             py_1          13 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    tensorflow-2.0.0           |mkl_py36h781710d_0           4 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    msys2-conda-epoch-20160418 |                1           2 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    protobuf-3.11.4            |   py36h97ec31f_1         584 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    m2w64-gcc-libgfortran-5.3.0|                6         340 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    intel-openmp-2019.4        |              245         1.7 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    numpy-1.18.1               |   py36h48dd78f_1         4.7 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    h5py-2.9.0                 |py36hf098a70_1000         915 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    absl-py-0.9.0              |   py36h9f0ad1d_1         162 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    _tflow_select-2.3.0        |              mkl           3 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    tensorboard-2.0.0          |     pyhb38c66f_1         3.3 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    python_abi-3.6             |          1_cp36m           4 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    keras-applications-1.0.8   |             py_1          30 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    grpcio-1.23.0              |   py36hc6b9980_1         1.0 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libmklml-2019.0.5          |                0        21.4 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    pyreadline-2.1             |           py36_0         139 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    blas-1.0                   |              mkl           6 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    libprotobuf-3.11.4         |       h1a1b453_0         2.2 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    scipy-1.3.1                |   py36h29ff71c_0        14.4 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    mkl-2019.4                 |              245       157.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    gast-0.2.2                 |             py_0          10 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    werkzeug-0.16.1            |             py_0         255 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    liblapack-3.8.0            |           14_mkl         3.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    setuptools-46.1.3          |   py36h9f0ad1d_0         660 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    m2w64-gcc-libs-core-5.3.0  |                7         213 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    mkl-service-2.3.0          |   py36hfa6e2cd_0          52 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    tensorflow-estimator-2.0.0 |     pyh2649769_0         272 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    icc_rt-2019.0.0            |       h0cc432a_1         9.4 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    m2w64-gcc-libs-5.3.0       |                7         518 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    vc-14.1                    |       h869be7e_1           6 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    m2w64-gmp-6.1.0            |                2         689 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    opt_einsum-3.2.0           |             py_0          49 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    astor-0.7.1                |             py_0          22 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    zlib-1.2.11                |    h2fa13f4_1006         236 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    vs2015_runtime-14.16.27012 |       h30e32a0_1         2.2 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    hdf5-1.10.4                |nompi_hcc15c50_1106        34.9 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    ca-certificates-2020.4.5.1 |       hecc5488_0         184 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    markdown-3.2.1             |             py_0          61 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    google-pasta-0.2.0         |     pyh8c360ce_0          42 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    termcolor-1.1.0            |           py36_0           8 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    libcblas-3.8.0             |           14_mkl         3.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    tensorflow-base-2.0.0      |mkl_py36hd1d5974_0        41.9 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    ------------------------------------------------------------
                                           Total:       315.7 MB

The following NEW packages will be INSTALLED:

    _tflow_select:           2.3.0-mkl                  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    absl-py:                 0.9.0-py36h9f0ad1d_1       https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    astor:                   0.7.1-py_0                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    blas:                    1.0-mkl                    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    ca-certificates:         2020.4.5.1-hecc5488_0      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    gast:                    0.2.2-py_0                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    google-pasta:            0.2.0-pyh8c360ce_0         https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    grpcio:                  1.23.0-py36hc6b9980_1      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    h5py:                    2.9.0-py36hf098a70_1000    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    hdf5:                    1.10.4-nompi_hcc15c50_1106 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    icc_rt:                  2019.0.0-h0cc432a_1        https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    intel-openmp:            2019.4-245                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    keras-applications:      1.0.8-py_1                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    keras-preprocessing:     1.1.0-py_0                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libblas:                 3.8.0-14_mkl               https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libcblas:                3.8.0-14_mkl               https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    liblapack:               3.8.0-14_mkl               https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    libmklml:                2019.0.5-0                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    libprotobuf:             3.11.4-h1a1b453_0          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    m2w64-gcc-libgfortran:   5.3.0-6                    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    m2w64-gcc-libs:          5.3.0-7                    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    m2w64-gcc-libs-core:     5.3.0-7                    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    m2w64-gmp:               6.1.0-2                    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    m2w64-libwinpthread-git: 5.0.0.4634.697f757-2       https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    markdown:                3.2.1-py_0                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    mkl:                     2019.4-245                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    mkl-service:             2.3.0-py36hfa6e2cd_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    msys2-conda-epoch:       20160418-1                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
    numpy:                   1.18.1-py36h48dd78f_1      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    openssl:                 1.1.1f-hfa6e2cd_0          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    opt_einsum:              3.2.0-py_0                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    protobuf:                3.11.4-py36h97ec31f_1      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    pyreadline:              2.1-py36_0                 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    python_abi:              3.6-1_cp36m                https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    scipy:                   1.3.1-py36h29ff71c_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    six:                     1.14.0-py_1                https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    tensorboard:             2.0.0-pyhb38c66f_1         https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    tensorflow:              2.0.0-mkl_py36h781710d_0   https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    tensorflow-base:         2.0.0-mkl_py36hd1d5974_0   https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    tensorflow-estimator:    2.0.0-pyh2649769_0         https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    termcolor:               1.1.0-py36_0               https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    werkzeug:                0.16.1-py_0                https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    wrapt:                   1.12.1-py36h68a101e_1      https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    zlib:                    1.2.11-h2fa13f4_1006       https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

The following packages will be UPDATED:

    certifi:                 2016.2.28-py36_0           https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free         --> 2020.4.5.1-py36h9f0ad1d_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    setuptools:              36.4.0-py36_1              https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free         --> 46.1.3-py36h9f0ad1d_0     https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    vc:                      14-0                       https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free         --> 14.1-h869be7e_1           https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
    vs2015_runtime:          14.0.25420-0               https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free         --> 14.16.27012-h30e32a0_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

Proceed ([y]/n)? y


Downloading and Extracting Packages
certifi-2020.4.5.1   |  151 KB | ############################################################################## | 100%
m2w64-libwinpthread- |   30 KB | ############################################################################## | 100%
openssl-1.1.1f       |  4.7 MB | ############################################################################## | 100%
keras-preprocessing- |   33 KB | ############################################################################## | 100%
wrapt-1.12.1         |   44 KB | ############################################################################## | 100%
libblas-3.8.0        |  3.5 MB | ############################################################################## | 100%
six-1.14.0           |   13 KB | ############################################################################## | 100%
tensorflow-2.0.0     |    4 KB | ############################################################################## | 100%
msys2-conda-epoch-20 |    2 KB | ############################################################################## | 100%
protobuf-3.11.4      |  584 KB | ############################################################################## | 100%
m2w64-gcc-libgfortra |  340 KB | ############################################################################## | 100%
intel-openmp-2019.4  |  1.7 MB | ############################################################################## | 100%
numpy-1.18.1         |  4.7 MB | ############################################################################## | 100%
h5py-2.9.0           |  915 KB | ############################################################################## | 100%
absl-py-0.9.0        |  162 KB | ############################################################################## | 100%
_tflow_select-2.3.0  |    3 KB | ############################################################################## | 100%
tensorboard-2.0.0    |  3.3 MB | ############################################################################## | 100%
python_abi-3.6       |    4 KB | ############################################################################## | 100%
keras-applications-1 |   30 KB | ############################################################################## | 100%
grpcio-1.23.0        |  1.0 MB | ############################################################################## | 100%
libmklml-2019.0.5    | 21.4 MB | ############################################################################## | 100%
pyreadline-2.1       |  139 KB | ############################################################################## | 100%
blas-1.0             |    6 KB | ############################################################################## | 100%
libprotobuf-3.11.4   |  2.2 MB | ############################################################################## | 100%
scipy-1.3.1          | 14.4 MB | ############################################################################## | 100%
mkl-2019.4           | 157.5 MB | ############################################################################# | 100%
gast-0.2.2           |   10 KB | ############################################################################## | 100%
werkzeug-0.16.1      |  255 KB | ############################################################################## | 100%
liblapack-3.8.0      |  3.5 MB | ############################################################################## | 100%
setuptools-46.1.3    |  660 KB | ############################################################################## | 100%
m2w64-gcc-libs-core- |  213 KB | ############################################################################## | 100%
mkl-service-2.3.0    |   52 KB | ############################################################################## | 100%
tensorflow-estimator |  272 KB | ############################################################################## | 100%
icc_rt-2019.0.0      |  9.4 MB | ############################################################################## | 100%
m2w64-gcc-libs-5.3.0 |  518 KB | ############################################################################## | 100%
vc-14.1              |    6 KB | ############################################################################## | 100%
m2w64-gmp-6.1.0      |  689 KB | ############################################################################## | 100%
opt_einsum-3.2.0     |   49 KB | ############################################################################## | 100%
astor-0.7.1          |   22 KB | ############################################################################## | 100%
zlib-1.2.11          |  236 KB | ############################################################################## | 100%
vs2015_runtime-14.16 |  2.2 MB | ############################################################################## | 100%
hdf5-1.10.4          | 34.9 MB | ############################################################################## | 100%
ca-certificates-2020 |  184 KB | ############################################################################## | 100%
markdown-3.2.1       |   61 KB | ############################################################################## | 100%
google-pasta-0.2.0   |   42 KB | ############################################################################## | 100%
termcolor-1.1.0      |    8 KB | ############################################################################## | 100%
libcblas-3.8.0       |  3.5 MB | ############################################################################## | 100%
tensorflow-base-2.0. | 41.9 MB | ############################################################################## | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(tf2.0) C:\Users\Awen>python
Python 3.6.5 | packaged by conda-forge | (default, Apr  6 2018, 16:13:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> print(tf.__version__)
2.0.0
>>> exit()

(tf2.0) C:\Users\Awen>cd C:\Users\Awen\Desktop\NLP\code\01

(tf2.0) C:\Users\Awen\Desktop\NLP\code\01>jupyter notebook
[I 00:56:53.808 NotebookApp] JupyterLab beta preview extension loaded from D:\Anaconda3\lib\site-packages\jupyterlab
[I 00:56:53.809 NotebookApp] JupyterLab application directory is D:\Anaconda3\share\jupyter\lab
[I 00:56:54.154 NotebookApp] Serving notebooks from local directory: C:\Users\Awen\Desktop\NLP\code\01
[I 00:56:54.154 NotebookApp] 0 active kernels
[I 00:56:54.154 NotebookApp] The Jupyter Notebook is running at:
[I 00:56:54.154 NotebookApp] http://localhost:8888/?token=fb3cb1703589524627dced286d8ca5e190efbe203ea2468b
[I 00:56:54.155 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 00:56:54.156 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=fb3cb1703589524627dced286d8ca5e190efbe203ea2468b&token=fb3cb1703589524627dced286d8ca5e190efbe203ea2468b
[I 00:56:54.521 NotebookApp] Accepting one-time-token-authenticated connection from ::1

参考链接:https://blog.csdn.net/CampusAmour/article/details/83215524

 

  • 2
    点赞
  • 63
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
虚拟环境是为了隔离不同的Python环境,以便在同一台机器上使用不同版本的Python和依赖包。在使用Anaconda创建虚拟环境时,常用的指令包括: 1. 创建虚拟环境: 使用命令`conda create -n [环境名`来创建一个新的虚拟环境。 2. 激活虚拟环境: 使用命令`conda activate [环境名`来激活并切换到你指定的虚拟环境。 3. 安装包: 激活虚拟环境后,可以使用命令`pip install [包名`在特定的环境下安装需要的包。 4. 查看所有环境: 使用命令`conda info --envs`可以查看当前所有的虚拟环境。 5. 复制虚拟环境: 使用命令`conda create -n [新环境名 --clone [源环境名`可以复制一个已有的虚拟环境。 6. 删除虚拟环境: 使用命令`conda remove -n [环境名 --all`可以删除指定的虚拟环境。 7. 在Jupyter Notebook中添加虚拟环境: 使用命令`conda install nb_conda`可以安装nb_conda包,从而在Jupyter Notebook中添加虚拟环境。 这些指令可以帮助你创建、激活、安装包和管理Anaconda虚拟环境。希望对你有帮助!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [Anaconda 虚拟环境命令介绍](https://blog.csdn.net/liangjingxin4747/article/details/122830815)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [anaconda虚拟环境常用命令+安装GPU驱动+pytorch+tensorflow_gpu](https://blog.csdn.net/shunzi1013238638/article/details/115188042)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Steven灬

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值