python安裝
windows
- 下載安裝包 https://www.python.org/downloads
- 改環境變量 【右鍵計算機】--》【屬性】--》【高級系統設置】--》【高級】--》【環境變量】--》 如:原來的值;C:\python3,切記前面有分號
linux
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz tar xf Python-3.5.2.tgz cd Python-3.5.2 ./configure --prefix=/usr/local/python3 --enable-shared make make install ln -s /usr/local/python3/bin/python3.5 /usr/bin/python
這時候執行python3會報錯
python: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory
echo "/usr/local/python3/lib" > /etc/ld.so.conf # ldconfig
模塊安裝(三種方式)
1、 pip install 模塊名
easy_install 模塊名
如果pip安裝慢的話,用阿里雲的源吧
pip install 模塊名 -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
在linux上需要改環境變量,不然無法使用pip安裝模塊
vim /etc/profile 加入一行 export PATH=/usr/local/python3/bin:$PATH source /etc/profile
2、下載壓縮包,解壓縮,進入解壓縮目錄,python setup.py install
3、直接在pychram里安裝
File-Settings-Project-Project-Interpreter
功能很強大,能更新能安裝