Having trouble getting pyflakes to run on windows.
On Windows there is no apt install , so… what to do?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I downloaded the pyflakes tgz file (v0.5.0) from Pypi, and was able to unpack it with a tar tool.
Now I had a directory that looked like this:
Next I tried the obvious: run the
setup.pyfile. It told me to useinstall, soThat gave me a happy message about building and installing the module, culminating in
ok, now …
(dinner break)
now, the install of pyflakes puts a file called “pyflakes” into
c:\Python27\Scripts.To run the pyflakes checker, use this:
That’s it! It works.
But there is more to the story. The contents of the file
c:\Python27\Scripts\pyflakesis python source code. Now, you may think, what’s the deal with a python module with no .py extension? Other files in that directory are correctly marked with the .py extension. It just feels wrong to leave the extension off. Why would they do that? If you get creative and rename that file called “pyflakes” to “pyflakes.py”, and then try to run that, you will get this error:The problem is a naming clash between the (renamed) pyflakes.py file, and the module that it imports, which is located at
c:\Python27\Lib\site-packages\pyflakes. So, don’t rename it that way. If you insist on having a .py extension, then choose something other than pyflakes.py for the name – for example, pyflakes_driver.py works just fine. Some people use runpyflakes.py .If you do run into the problem described above, you also need to remove the pyflakes.pyc that may have been created in the c:\Python27\Scripts directory.
People might also want to create a .bat or .cmd file to launch pyflakes. To help with this I created c:\Python27\pyflakes.cmd, with these contents:
ok, that’s it.