Python开发环境

Posted on 2022-12-25 19:50  Charlie_ODD  阅读(57)  评论(0编辑  收藏  举报

说明:要清楚领域核心包,所依赖的环境;推荐进行多版本管理,构建虚拟环境;

技术栈:

  • 深度学习框架:Pytorch、tensorflow 1.x tensorflow 2.x
  • 机器学习框架:scikit-learn
  • 数据处理工具包:numpy、pandas
  • 可视化:matplotlib
  • 其他:Xgboost

以下为阿里算法平台的推荐版本为:

python==3.6
tensorflow==1.13.1(cpu & gpu)
torch==1.5.0
prophet==1.0.1
cuda==10.0
tfplus==1.0.9
penrose=2.0.0

 

常见包安装:

Python 3.6.5

python -m pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple tensorflow==1.13.1

python -m pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple torch==1.5.0

安装包pytorch指定源和版本:

安装python 3.6

# python 3.6
export PATH=${PATH}:/Users/yonglang/anaconda3/python.app/Contents/bin
alias python="/Users/yonglang/anaconda3/python.app/Contents/MacOS/python"
alias pip="/Users/yonglang/anaconda3/python.app/Contents/MacOS/pip3"

源地址:

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
阿里云 http://mirrors.aliyun.com/pypi/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

Anaconda

#anaconda地址
https://repo.anaconda.com/archive/     
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

python 3.6   <---->  Anaconda3 5.2   [推荐]

Tensorflow

https://www.tensorflow.org/install

中文使用教程:https://zhuanlan.zhihu.com/p/59507137

https://github.com/czy36mengfei/tensorflow2_tutorials_chinese

英文教程:https://github.com/Hvass-Labs/TensorFlow-Tutorials

Deepo

【深度学习环境镜像】

https://hub.docker.com/r/ufoym/deepo/#CPU

https://github.com/ufoym/deepo.git

-- cpu version --
Installation
Step 1. Install Docker.
Step 2. Obtain the all-in-one image from Docker Hub
        docker pull docker.mirrors.ustc.edu.cn/ufoym/deepo:cpu
    
    docker run -it docker.mirrors.ustc.edu.cn/ufoym/deepo:cpu bash

        exit

[Recommend]--->
docker run -it -v /Users/yonglang/PycharmProjects:/mnt  docker.mirrors.ustc.edu.cn/ufoym/deepo:cpu bash

Jupyter support

Step 1. pull the image with jupyter support

docker pull ufoym/deepo:all-jupyter

Step 2. run the image

docker run -it -p 8888:8888 -p 8022:22 --ipc=host ufoym/deepo:all-jupyter jupyter notebook --no-browser --ip=0.0.0.0 --allow-root --NotebookApp.token= --notebook-dir='/root'

然后打开:
http://localhost:8888/

上传文件:

https://blog.csdn.net/wzw2887/article/details/120469027