linux 安装python3.6.3命令
时间: 2023-09-15 21:19:57 浏览: 82
1. 首先需要安装依赖库:
```
sudo apt-get update
sudo apt-get install -y build-essential checkinstall
sudo apt-get install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
```
2. 下载Python 3.6.3源代码:
```
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
tar -xzvf Python-3.6.3.tgz
cd Python-3.6.3
```
3. 编译安装Python 3.6.3:
```
./configure
make
sudo make install
```
4. 验证安装:
```
python3.6 -V
```
相关问题
linux 安装python
在Linux上安装Python可以按照以下步骤进行操作:
1. 首先,检查系统中是否已经安装了默认的Python版本。比如在CentOS6.5上,默认的Python版本是2.6.6。如果需要安装其他版本的Python,可以按照以下步骤进行。
2. 提前安装必要的依赖模块,例如openssl、readline等。可以使用以下命令安装这些依赖:
yum -y install zlib zlib-devel
yum -y install bzip2 bzip2-devel
yum -y install ncurses ncurses-devel
yum -y install readline readline-devel
yum -y install openssl openssl-devel
yum -y install openssl-static
yum -y install xz lzma xz-devel
yum -y install sqlite sqlite-devel
yum -y install gdbm gdbm-devel
yum -y install tk tk-devel
yum install gcc
3. 下载Python安装包,可以从Python官方网站上下载所需版本的安装包。例如,下载Python3.6.3的安装包。
4. 解压安装包,并进入解压后的文件夹。
5. 运行以下命令进行编译和安装:
./configure
make
make install
6. 安装完成后,可以通过命令行输入python3来启动Python3.6.3。
请注意,Python3.6.3自带了pip和setuptools,用于安装和管理Python扩展包。配置pip进行扩展包的下载可以参考其他相关的指南。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Linux下安装Python](https://blog.csdn.net/gdkyxy2013/article/details/79457590)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文