Tuesday, July 8, 2014

Pyton - download, install and get Pycharm IDE

 Last week I decided to take a look a Python since it's been around quite awhile and I've never used it.  I have found it to have a simple install (with a little caveat around getting the registry keys properly configured in order to  be able to download helpful modules).  The language itself is one that a programmer can quickly pick up the basics too, although it has advanced features that will take awhile to master (at least that is so for me).  I am a self learned Java/ant hacker and I find I like the scripting ability of Python.  However, what makes it really fun and quick to come up to speed on is having a solid IDE to develop the scripts with.  That is where Pycharm comes in.  With it's debugging, auto type, auto format and other features, it makes coming up to speed with Python a much simpler task.  Below is how I got started....

Download Python

Download Python: https://www.python.org/download/
  • by default, installs to c:\Python## where ## is version number, ex Python34
  • installer updates/add HKEY_LOCAL_MACHINE\SOFTWARE\PYTHON registry entry

Adding HKEY_CURRENT_USER Registry entry

Some Python module installers look in the HKEY_CURRENT_USER registry entry for the Python settings so need to get the info there
  • http://choorucode.com/2012/04/28/python-version-not-found-in-registry-error/
    1. open regedit
    2. navigate to Computer->HKEY_LOCAL_MACHINE->SOFTWARE->Python
    3. right click 3.4 -> Export
    4. save as .reg file on your system, ex. c:\Users\yourname\python3.4.reg
    5. edit .reg file and change all HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER
    6. open cmd box as administrator
    7. cd to where .reg file was saved
    8. install using regedit command
      1. c:> regedit python3.4.reg
        • keys should be successfully added to registry
        • verify using regedit that Computer->HKEY_CURRENT_USER->SOFTWARE->Python exists

Installing Python modules

Module install can be done using pip or by double clicking the module if it is an installer.

Modules/Packages

libxml

XML processing library combining libxml2 and libxslt libraries and providing a safe and convenient access to the libraries using the ElementTree API.
  • need to install manually on windows....dont try installing using PyCharm->Settings since it requires building it which you cant do (ok you might be able to, but it wont be easy)
  • get the libxml installer

PyCharm IDE

PyCharm is a Python IDE put out by JetBrains
Adding packages (ex. PyGitHub) using PyCharm Settings
  • start PyCharm
  • File -> Settings -> Project Interpreter
  • click on the +
  • in search bar, type PyGitHub
  • click Install Package

No comments:

Post a Comment