简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM