• python 从ubantu环境迁移到windows环境


    下载安装Anaconda3

    Anaconda3-2021.05-Windows-x86_64.exe

    默认安装目录

    C:ProgramDataAnaconda3

    可以启动Anaconda查看不同的环境

    也可打开Powershell进行命令行操作

    创建一个Python36环境

    这里用到了tensorflow1.8,只能安装python36

    conda create --name tf1 python=3.6
    conda env list

    PS D:wks_ai> conda env list
    # conda environments:
    #
    base                  *  C:ProgramDataAnaconda3
    tf1                      C:Userslen.condaenvs	f1
    (base) PS C:Userslen> conda activate tf1
    (tf1) PS C:Userslen> python
    Python 3.6.13 |Anaconda, Inc.| (default, Mar 16 2021, 11:37:27) [MSC v.1916 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>

    vscode配置

    ctrl + Shift + P

    选择解释器

    从原环境中导出一份pip list

    pip freeze > tf1.txt

    absl-py==0.13.0
    astor==0.8.1
    bleach==1.5.0
    certifi==2021.5.30
    cycler==0.10.0
    dataclasses==0.8
    gast==0.5.0
    grpcio==1.38.1
    html5lib==0.9999999
    importlib-metadata==4.6.1
    joblib==1.0.1
    Keras==2.0.0
    kiwisolver==1.3.1
    Markdown==3.3.4
    matplotlib==3.3.4
    numpy==1.18.1
    pandas==1.1.5
    Pillow==8.3.1
    protobuf==3.17.3
    pyparsing==2.4.7
    python-dateutil==2.8.1
    pytz==2021.1
    PyYAML==5.4.1
    scikit-learn==0.24.2
    scipy==1.5.4
    six==1.16.0
    sklearn==0.0
    tensorboard==1.8.0
    tensorflow==1.8.0
    termcolor==1.1.0
    threadpoolctl==2.2.0
    typing-extensions==3.10.0.0
    Werkzeug==2.0.1
    zipp==3.5.0

    依次安装下面这些包

    pip install numpy==1.18.1
    pip install matplotlib==3.3.4
    pip install pandas==1.1.5
    pip install scikit-learn==0.24.2
    pip install six==1.16.0
    pip install zipp==3.5.0
    pip install tensorflow==1.8.0
    pip install Keras==2.0.0

     windows环境补充安装

     pip install win_unicode_console
     
     
    设置自定义python模块路径
    python -c "print('
    '.join(__import__('sys').path))"
    (base) ai@ai:/opt/app/anaconda3/envs/py37/lib/python3.7/site-packages$ conda activate py37
    (py37) ai@ai:/opt/app/anaconda3/envs/py37/lib/python3.7/site-packages$ python -c "print('
    '.join(__import__('sys').path))"
    
    /opt/aidoc/aitools/ait
    /opt/app/anaconda3/envs/py37/lib/python37.zip
    /opt/app/anaconda3/envs/py37/lib/python3.7
    /opt/app/anaconda3/envs/py37/lib/python3.7/lib-dynload
    /opt/app/anaconda3/envs/py37/lib/python3.7/site-packages
    (py37) ai@ai:/opt/app/anaconda3/envs/py37/lib/python3.7/site-packages$ cd /opt/app/anaconda3/envs/py37/lib/python3.7/site-packages
    (py37) ai@ai:/opt/app/anaconda3/envs/py37/lib/python3.7/site-packages$ vim ait.pth
    (py37) ai@ai:/opt/app/anaconda3/envs/py37/lib/python3.7/site-packages$ 
    (py37) ai@ai:/opt/app/anaconda3/envs/py37/lib/python3.7/site-packages$ cat ait.pth 
    /opt/aisty/doc/aitools/ait
     
  • 相关阅读:
    [dev][ipsec][esp] ipsec链路中断的感知问题
    [dev] Go语言查看doc与生成API doc
    [daily]gtk程序不跟随系统的dark主题
    [dev] Go的协程切换问题
    基因程序设计/基因编程/遗传编程
    [daily][emacs][go] 配置emacs go-mode的编辑环境以及环境变量问题
    Java Spring中@Query中使用JPQL LIKE 写法
    JavaScript 使用HTML DOM的oninput事件,实时监听value值变化
    Java中执行.exe文件
    Java关于List<String> 进行排序,重写Comparator()方法
  • 原文地址:https://www.cnblogs.com/perfei/p/15016649.html
Copyright © 2020-2023  润新知