1. 程式人生 > >python初識

python初識

python pycharm

yum安裝python3.6
]#yum install python36 -y
]#mkdir /data/workspace
]#cd /data/workspace
]#python36 -m venv env1    ]#pyvenv-3.6 env1   #等價這個命令
]#cd /data/workspace/env1/bin/
]#. activate
(env1)[root@··]#python -m pip install --upgrade pip
(env1)[root@··]#python --version
Python 3.6.3

編譯安裝python36

]#yum groupinstall "Development Tools"
]#yum install openssl-devel -y
]#tar xf Python3.6
]#cd Python3.6
]#./configure --prefix=/usr/local/python36
]#make -j 4 && make install
···
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-9.0.3 setuptools-39.0.1

]#cd /usr/local/python36/bin
]#./python3.6 -m venv /data/env1
]#cd /data/env1/bin/
]#. activate
(env1)[root@··]#python -m pip install --upgrade pip
(env1)[root@··]#python --version
Python 3.6.5

安裝pycharm

下載好pycharm

]#wget https://download.jetbrains.com/python/pycharm-community-2018.1.4.tar.gz
]#tar -xf pycharm-community-2018.1.4.tar.gz  -C /usr/local
]#cd /usr/local
]#mv pycharm-community-2018.1.4 pycharm20180104
]#cd pycharm20180104/bin/
]#./pycharm.sh

接受相關許可及主題風格選擇

技術分享圖片

選擇pycharm的運行文件

技術分享圖片

選擇額外的文本編輯模式的配置,可以不選擇

技術分享圖片

python的環境配置

location:/root/PycharmProjects/venvs/env1

base interpreter: /usr/local/bin/python3.6

技術分享圖片

下次可以直接用charm;命令調用pycharm

]#charm

開始python3&pycharm的愉快之旅吧!

python初識