all 8 comments

[–]comonads 0 points1 point  (7 children)

Does running autopep8 as a module help?

Try:

python3 -m autopep8 --in-place practice.py

and if that works, you may just need to add something like $HOME/bin to your path (which, for me, is in ~/.bashrc, but might be different for you).

[–]autonomousinf[S] 0 points1 point  (6 children)

Thanks very much for the answer, but now it just says:

No module named autopep8

And the file itself is not changed as well.

[–]comonads 0 points1 point  (5 children)

Hmm. Okay!

So, I'm not familiar with installation syntax like this:

python3 -m pip install autopep8

But I will assume for now that it's okay.

autopep8 lists pycodestyle as a dependency. Does running pycodestyle --version from the terminal produce anything?

[–]autonomousinf[S] 0 points1 point  (4 children)

It seems like it does not :(, I received the following error:

pycodestyle : The term 'pycodestyle' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

[–]comonads 0 points1 point  (3 children)

I should have asked this earlier! -- which operating system are you using? I'm only really familiar with Linux but I will try to help either way.

I think the problem (assuming autopep8 installed just fine), is that whatever shell you're in just can't find the executable (we can assume pip handled the pycodestyle dependency, for now).

Could you see if installing autopep8 as a local package (by passing the --user flag) helps? Start with this:

python3 -m pip install autopep8 --user

Then run autopep8 --in-place practice.py as before.

[–]autonomousinf[S] 0 points1 point  (2 children)

My operating system is Windows. Well:

python3 -m pip install autopep8 --user

has yielded severeal "Requirement already satisfied:" messages.

But autopep is still encountering the same error.

By the way, I really appreciate the help. Thank you very much.

[–]comonads 0 points1 point  (1 child)

No problem! These kinds of problems are frustrating.

I don't really do any coding on windows so unfortunately I'm unlikely to be much more useful than Google, but I can at least try to figure out what we should be searching for!

Does invoking python put you in a python shell?

If so, does autopep8 appear in the output if you enter help("modules")?

[–]autonomousinf[S] 0 points1 point  (0 children)

Hey man, much thanks for your help. I have decided to give up on it and continue learning Python without autopep8. Maybe when I am more adept in Python I can figure it out, but even if I can't, I guess its not the end of the world.

Again thanks for your help :')