<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>python &#8211; 科技改变生活-雨落星辰</title>
	<atom:link href="https://p1e.cn/html/tag/python/feed" rel="self" type="application/rss+xml" />
	<link>https://p1e.cn</link>
	<description>所有的伟大,都源于一个勇敢的开始</description>
	<lastBuildDate>Thu, 27 Jan 2022 06:38:18 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>Centos7 yum安装Python3.6环境</title>
		<link>https://p1e.cn/html/752.html</link>
					<comments>https://p1e.cn/html/752.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Mon, 07 Jan 2019 05:06:18 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">http://www.815494.com/?p=752</guid>

					<description><![CDATA[配置好Python3.6和pip3 安装EPEL和IUS软件源 yum install epel-release -y yum install https://centos7.iuscommunity.org/ius-release.rpm -y 安装Python3.6 yum install python36u -y 创建python3连接符 ln -s /bin/python3.6 /bin/python3 安装pip3 yum install python36u-pip -y 创建pip3链接符 ln -s ]]></description>
										<content:encoded><![CDATA[<p>配置好Python3.6和pip3<br />
安装EPEL和IUS软件源</p>
<pre>yum install epel-release -y yum install https://centos7.iuscommunity.org/ius-release.rpm -y</pre>
<p>安装Python3.6</p>
<pre>yum install python36u -y</pre>
<p>创建python3连接符</p>
<pre>ln -s /bin/python3.6 /bin/python3</pre>
<p>安装pip3</p>
<pre>yum install python36u-pip -y</pre>
<p>创建pip3链接符</p>
<pre>ln -s /bin/pip3.6 /bin/pip3</pre>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/752.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>宝塔面板设置python3默认环境</title>
		<link>https://p1e.cn/html/750.html</link>
					<comments>https://p1e.cn/html/750.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Mon, 07 Jan 2019 01:21:58 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">http://www.815494.com/?p=750</guid>

					<description><![CDATA[使用宝塔面板搭建web环境并配置python3为默认python环境 宝塔面板是一个可以通过Web端轻松管理服务器，提升运维效率的管理面板。它不仅可以方便的安装网站必须程序，而且可以创建管理网站、FTP、数据库，拥有可视化文件管理器，可视化CPU、内存、流量监控图表，计划任务等功能。因此搭建网站选用宝塔面板是非常方便的事情，但是一个服务器仅仅搭建一个小网站的话显得有点浪费，使用服务器跑些爬虫写点程序还是非常好的。 但是宝塔并没有默认的python3，由于python2已经不再维护，升级python3并设置为默认py]]></description>
										<content:encoded><![CDATA[<p>使用宝塔面板搭建web环境并配置python3为默认python环境</p>
<p> 宝塔面板是一个可以通过Web端轻松管理服务器，提升运维效率的管理面板。它不仅可以方便的安装网站必须程序，而且可以创建管理网站、FTP、数据库，拥有可视化文件管理器，可视化CPU、内存、流量监控图表，计划任务等功能。因此搭建网站选用宝塔面板是非常方便的事情，但是一个服务器仅仅搭建一个小网站的话显得有点浪费，使用服务器跑些爬虫写点程序还是非常好的。 但是宝塔并没有默认的python3，由于python2已经不再维护，升级python3并设置为默认python成为首先要做的事情。在网上查看各种教程并没有直接的相关内容，因此在摸索好搭建环境成功后把详细过程分享给大家，以防类似情况发生再次独自摸索。</p>
<p>首先简要说下过程，查看宝塔脚本vi /usr/bin/bt发现py26=$(python -V 2&gt;&amp;1|grep &#8216;2.6.&#8217;) if [ &#8220;$py26&#8221; != &#8220;&#8221; ];then pythonV=python3 fipython3是可以运行宝塔面板的，因此python3其实是兼容的，但是宝塔面板安装的时候要求的是python2，所以处理过程需要这样</p>
<p> 1.先运行宝塔面板安装脚本安装好面板</p>
<p> 2.安装好python3设置为默认python3</p>
<p> 3.修改yum使其使用python2</p>
<p>运行宝塔脚本安装宝塔面板</p>
<p> 纯净centos系统直接运行官方脚本安装，我这里系统是centos7，因此使用的是最新的linux面板6.0</p>
<pre class="ql-syntax" spellcheck="false">yum <span class="hljs-keyword">install</span> -y wget &amp;&amp; wget -O install.sh <span class="hljs-keyword">http</span>://download.bt.cn/<span class="hljs-keyword">install</span>/install_6<span class="hljs-number">.0</span>.sh &amp;&amp; bash install.sh
</pre>
<p> 安装好就有提示了，默认为8888端口，粘贴进入便可以看到了。</p>
<p>安装python3</p>
<p>由于熟悉而且非常强大的爬虫框架scrapy中python3里面3.6是兼容的，更高版本安装会出错，因此这里使用3.6.7作为本次安装的python版本</p>
<pre class="ql-syntax" spellcheck="false"><span class="hljs-attribute">wget</span> https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tgz

tar zxvf Python-<span class="hljs-number">3</span>.<span class="hljs-number">6</span>.<span class="hljs-number">7</span>.tgz

./configure

make &amp;&amp; make install
</pre>
<p>python3便安装好了</p>
<p>设置python3位默认python</p>
<pre class="ql-syntax" spellcheck="false">rm -f /usr/bin/python
ln -s /usr/<span class="hljs-built_in">local</span>/bin/python3 /usr/bin/python
rm /usr/bin/pip
ln -s /usr/<span class="hljs-built_in">local</span>/bin/pip /usr/<span class="hljs-built_in">local</span>/bin/pip
</pre>
<p>修改yum为python2</p>
<pre class="ql-syntax" spellcheck="false"><span class="hljs-attribute">vi</span> /usr/bin/yum
</pre>
<p>把/usr/bin/python 修改为/usr/bin/python2</p>
<p>修改好后使用</p>
<pre class="ql-syntax" spellcheck="false">yum <span class="hljs-keyword">update</span> -y &amp;&amp; python <span class="hljs-comment">--version &amp;&amp;pip --version</span>
</pre>
<p>如果yum没有出错而且是python3，且pip版本是python3里面的说明环境搭建成功,接下来就可以方便的搭建好scrapy爬虫环境了。</p>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/750.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
