<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Ubuntu 14.04安装和使用python3.5]]></title><description><![CDATA[<p dir="auto">python3.5增加了很多非常棒的特性，比如协程。用起来很好，但是Ubuntu 14.04系统默认的源里面并没有包含。<br />
下面是Ubuntu 14.04 python3.5的安装方式</p>
<h4>添加源</h4>
<pre><code>sudo add-apt-repository ppa:fkrull/deadsnakes
</code></pre>
<h4>安装</h4>
<pre><code>sudo apt-get update
sudo apt-get install python3.5
</code></pre>
<h4>使用</h4>
<p dir="auto">网上很多的安装教程是把python3.5替换成系统默认的python环境。这样并不好。可能会引起系统的问题。<br />
推荐的使用方法是用virtualenv</p>
<h4>安装virtualenv</h4>
<pre><code>sudo apt-get install python-virtualenv
</code></pre>
<h4>使用virtualenv</h4>
<p dir="auto">在你的代码文件夹内执行</p>
<pre><code>virtualenv -p /usr/bin/python3.5 venv
</code></pre>
<p dir="auto">这样会在当前路径下创建一个venv的文件夹，执行下面的指令</p>
<pre><code>source venv/bin/activate
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1494558117605-screenshot-from-2017-05-12-11-01-51.png" alt="0_1494558117617_Screenshot from 2017-05-12 11:01:51.png" class=" img-responsive img-markdown" width="670" height="79" /><br />
这时候终端的前面会多出一个venv的字符。这说明已经进入python的虚拟环境了。在这里安装的python包不会对系统产生影响，反之系统的包也不会对当前环境产生影响。注意一定不能用<code>sudo pip install xxxx</code>来安装python包。这样会安装到系统里面去。直接<code>pip instal xxxx</code>就可以了。</p>
]]></description><link>http://community.bwbot.org/topic/192/ubuntu-14-04安装和使用python3-5</link><generator>RSS for Node</generator><lastBuildDate>Thu, 15 Oct 2026 01:39:27 GMT</lastBuildDate><atom:link href="http://community.bwbot.org/topic/192.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 May 2017 03:04:51 GMT</pubDate><ttl>60</ttl></channel></rss>