0

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...

inirlan
  • 18
  • 1
  • 8
  • You said you already know how to call `pip install pycallgraph`. Did you mean this command didn't succeed? And if it didn't what error did you get? – jsalonen Sep 24 '14 at 13:12
  • Also if you just run `pip` what does it say? – jsalonen Sep 24 '14 at 13:12
  • Okay, I think you are severely overestimating what I know. What did was : 1 - just copy 'pip install pycallgraph' after importing pip and seeing what happens(a SyntaxError). 2 - copying that into cmd.exe and seeing if that works. 3 - copying that into cmd.exe but prefaced by python 4 - typing python(after understanding that it called up the interpreter inside cmd.exe. Yeah, never really used cmd.exe before) and then importing pip before copying the line and trying to run it. 5 - same thing but writing 'run' before the whole thing – inirlan Sep 24 '14 at 13:30
  • If it type pip into cmd.exe directly it tells me that it's not recognized(I would copy what it exactly says, but my Windows is in French so it probably wouldn't help). If I first type python and import pip I get : – inirlan Sep 24 '14 at 13:34
  • See my answer. You need to run `pip` commands from command-line, not from Python interpreter. – jsalonen Sep 24 '14 at 13:40

1 Answers1

1

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
jsalonen
  • 29,593
  • 15
  • 91
  • 109
  • Step one works, it tells me that pip is already up to date and performs a cleanup. For step two... I get something which roughly translates to "'pip' hasn't been recognized as an internal or external command, an executable programme or a command file." – inirlan Sep 24 '14 at 13:50
  • Okay, I managed to find a post which explained what I needed to do, based on how you explained things. Since you said that pip on his own should display help(it displayed the message that it hasn't been recognized), I did check for pip + "hasn't been recognized" and managed to find another question here which told me that I needed to change my Path variable. After abit of googling I found the step by step guide for that on Java.com – inirlan Sep 24 '14 at 14:30
  • Oh yeah you do need to setup PATH variable if that is not done! – jsalonen Sep 25 '14 at 05:37