Search code examples
pythonpippycallgraph

How do you install PyCallGraph / use pip?


and thanks to anyone who gives some of their time to consider my problem.

What I need help on is for someone to give me a simple and accessible explanation on how to install that module. I have never, ever used anything from PyPi before, I have only heard of pip after looking up PyCallGraph.

I'm not a programmer first, I'm doing an accounting internship and am using python to write scripts to help me speed up some processes, at the urging of a colleague who himself uses python. I write scripts using Notepad++ and execute them through IDLE.

I'm currently working on optimizing a script I wrote and came upon PyCallGraph while checking this very site on tips on how to do so.

I tried the very minimalistic instruction of just doing "pip install pycallgraph" just about anywhere I could think of, including cmd.exe, to no avail. Runing get-pip.py directly seems to have worked for installing pip, though.

Otherwise I can always just stick with the cProfile printout and write-off using modules needing such an install, although that saddly seems to be quite a few...


Solution

  • Step 1: Install PIP

    • Open terminal (cmd.exe, PowerShell, whatever)
    • Download get-pip.py and place it in the working directory of your terminal
    • Install PIP by invoking python get-pip.py
    • Confirm that PIP was installed correctly by invoking command pip (should display help if success)
    • If pip didn't work, make sure your PATH environment variable has been set up correctly. In typical Windows installations pip is installed under c:\Python27\Scripts. Make sure this folder is included in PATH.

    Step 2: Install your library with PIP

    • Invoke pip install pycallgraph
    • PIP installs the library and it can be now used from Python