pythonwindowssublimetext3cpplint

How to install cpplint on windows?


So I'm trying to get cpplint to work on Sublime Text 3 and I downloaded cppcheck and cpplint using the package installer on Sublime and now I'm trying to follow these instructions https://github.com/SublimeLinter/SublimeLinter-cpplint

I installed Python and I think I installed the get-pip since using the command prompt told me that pip is up to date but when I get to where it says run

[sudo] pip install cpplint

I'm lost.

I already put Python34 on my path and from my understanding, sudo is a Linux command that is the equivalent as runas in windows. I tried running this many different ways including typing in the complete path to cpplint. Can somebody help me?


Solution

  • pip usually live in C:\Python2x\Scripts. You will need to add that to your path as well. Then you should be able to call pip from the command line. Just try opening cmd.exe and type pip and then enter. It should print out a bunch of helpful information about pip. If it just gives you an unrecognized command, then you probably added it to the path incorrectly.

    You can also run pip like this:

    c:\Python27\pip.exe install somePackage
    

    If you're running cmd.exe as an admin user, this should work just fine. When I have downloaded a package that I want to install with pip, I usually open cmd.exe and then change directory to the file's location. So on your command line, you would do something like this:

    cd c:\path\to\cpplint
    

    Now that you're in the right location you can run dir to get a listing of what's in that folder. This is a good sanity check as sometimes when you unzip a package, there's a subfolder you need to navigate into to get at the setup.py script. If you see the setup.py, go up one level and do the following:

    c:\Python27\Scripts\pip.exe install -e directoryName
    

    See Can I use `pip` instead of `easy_install` for `python setup.py install` dependency resolution?

    Alternatively, you can go into the folder with setup.py and just run the following, skipping pip entirely:

    python setup.py install
    

    Finally, you can also use pip to install from the zipped download:

    pip install c:\path\to\zipped\package
    

    See also: