- Download the Eclipse: https://eclipse.org
- Optional: if Java is not updated, download the up to date JDK, note not jre.
- Install the Eclipse: choose “for java developer”or “for php” or something similar, this option does not really matter. we will install the Pydev later.
- Then go to: Help> Eclipse Marketplace
- Then go to popular , you can easily find the Pydev
- After installation, we need to configure the interpreters: click Eclipse > preference , then click Pydev>interpreters> python interpreter. in right panel, click advanced Auto-config.
Choose the python version if you have multiple version. Then click OK. - Then in Eclipse, click file > new – project > PyDev > PyDev Project , click next > Then give a name, Select the Grammar Version, Interpreter, click finish.
Now its ready for the programming!
Pip
Pip is a convenient tool to download and install the third party python packages.
If you have Python 3 but only the Python 2 version of pip, here’s how to get the Python
3 version on Linux or OS X:
$ curl –O http://python–distribute.org/distribute_setup.py
$ sudo python3 distribute_setup.py
$ curl –O https://raw.github.com/pypa/pip/master/contrib/get–pip.py
$ sudo python3 get–pip.py
This installs pip-3.3 in the bin directory of your Python 3 installation. Then, use pip-3.3 to install third-party Python packages rather than Python 2’s pip.
$ pip3.3 install otherpackage //install otherpackage for python 3.3 $ pip2.7 install mybarpackage // install mybarpackage for python 2.7
Multiple Version Python in Ubuntu
You can install multiple Python version in Ubuntu:
Go to https://www.python.org/downloads/, download the source code, and complie with :
./configure sudo make sudo make install
Find the version location:
which python3.5 /usr/bin/python3.5 which python3.6 /usr/local/bin/python3.6 which python3.7 /usr/bin/python3.7
Now we need to configure them with update-alternatives command:
The syntax is :
update-alternatives: --install needs <link> <name> <path> <priority>
so we are going to set them as
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1 sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.6 2 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 3
to choose the default version for the system:
sudo update-alternatives --config python
Then select the number under “Selection” as the default version.
Problems
TCL/TK version need to be updated
- I installed Python 3.6.0B3.
- Ran IDLE, got warning, “The version of Tcl/Tk (8.5.9) in use may be unstable.”
- Went to [Active State][1] and downloaded the suggested, “Download ActiveTcl 8.6.4 for Mac OS X (10.5+, x86_64/x86)”.
WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.
The IDLE will crush when I type ” or ‘ . So It need a fix.
Resolution
- Ran installer for “ActiveTcl8.6.4.1.299124-macosx10.5-i386-x86_64-threaded.dmg”
- Re-installed: python-3.6.0B3-macosx10.6.pkg
- Ran IDLE – still same message, “The version of Tcl/Tk (8.5.9) in use may be unstable.”.
- Checked – Yes, 8.6.4 is there.
Possible reason:
Try downloading the version that Python is looking for: 8.5.X. Version 8.6.X is not recognized.
http://downloads.activestate.com/ActiveTcl/releases/8.5.18.0/ActiveTcl8.5.18.0.298892-macosx10.5-i386-x86_64-threaded.dmg
- Went back to Active State http://downloads.activestate.com/ActiveTcl/releases/8.5.18.0/ and got prior version: http://downloads.activestate.com/ActiveTcl/releases/8.5.18.0/ActiveTcl8.5.18.0.298892-macosx10.5-i386-x86_64-threaded.dmg
- Re-installed: python-3.6.0B3-macosx10.6.pkg
- Ran IDLE – No warning.
http://downloads.activestate.com/ActiveTcl/releases/8.5.18.0/