Compile and install the latest version of Python and raspberrypython on Raspberry Pi.
The pre-installed version of Python 3 on Raspiban Wheezy is 3.2.3. This article will introduce how to upgrade to 3.4.1 (the latest version.
I used B + Raspberry Pi and installed the system with Raspbian Wheezy released on February 20.
Update the entire raspbian system to the latest version. You may need to restart the system after the upgrade.
1 sudo update2 sudo upgrade
Go to the home directory of the current user.
cd ~
Install the dependencies required by python.Some items may already exist and will be ignored automatically.
sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev
Download and decompress Python source code.When you see this article, there may be an updated version of Python.
The 2nd-line command will decompress the source code to the Python-3.4.1 directory under the current directory.
1 wget https://www.python.org/ftp/python/3.4.1/Python-3.4.1.tgz2 tar zxvf Python-3.4.1.tgz
Configure, compile, and install.If it succeeds, it will take about 1 hour and 20 minutes.
The parameter expression in line 2nd. We need to install the new version of python under the/opt/python3.4 directory.
1 cd ./Python-3.4.12 ./configure --prefix=/opt/python3.43 make && sudo make install
Create a soft link.In this way, you can start python 3.4.1 by playing python 3.
The first line deletes the existing soft links to python 3.2.3.
The soft link "/usr/bin/python3" created in the second line points to python 3.4.1.
The third line creates a soft link for pip. Pip has been officially integrated into python3.4. It is very convenient to use it to install third-party modules on pypi.
1 sudo rm /usr/bin/python32 sudo ln -s /opt/python3.4/bin/python3.4 /usr/bin/python33 sudo ln -s /opt/python3.4/bin/pip3.4 /usr/bin/pip3.4
So far, the installation is successful. You can start python 3.4.1 by running python 3.
It should be noted that sqlite3 can be used normally in the newly installed Python 3.4.1, but the sqlite version is old:
In Windows, Python 3.4.1 comes with sqlite 3.8.3.1. This is because Raspbian's built-in sqlite is used. Other modules used through links may also encounter this problem.
I would like to ask in what languages Raspberry Pi uses to write code.
Raspberry pi can be used to fl several systems
Debian linux
Android
Rasplt
The first two types are based on the Linux kernel. the Linux kernel is written in c/c ++. In fact, to learn more about Raspberry Pi, we 'd better use c, however, the vendor provides the python interface. If there is no foundation, you can use python to write it. It is relatively simple. python can also implement an encoding and run everywhere, but whatever the language is just a tool :).
Correct error: pi is not short for python. It has no special meaning, that is, "pi", which is named after food in the android version.
What systems can raspberry pi model B install?
Linux
The system can be downloaded at www.raspberrypi.org. You can select different versions.
In addition, it is said that the Android system has been released, but no download is available yet.