Pycharm exit code 0

You realize it is not part of the output right? It’s just additional information provided by the IDE’s console. The real program is just outputting hellow as expected. Saying that the Process finished with exit code 0 means that everything worked ok. If an exception occurs in your program or otherwise an exit is generated with non-zero argument, the IDE is … Read more

socket.error: [Errno 48] Address already in use

You already have a process bound to the default port (8000). If you already ran the same module before, it is most likely that process still bound to the port. Try and locate the other process first: The command arguments are included, so you can spot the one running SimpleHTTPServer if more than one python process is active. You … Read more

No acceptable C compiler found in $PATH when installing python

I’m trying to install a new Python environment on my shared hosting. I follow the steps written in this post: After coming to the ./configure –prefix=/home/<user>/.localpython command, I get the following output: How can this problem be solved? I’ve been trying to find a solution for 3 hours, but I’m still stuck in one place. UPDATE Hostgator does not … Read more

Error: ” ‘dict’ object has no attribute ‘iteritems’ “

As you are in python3 , use dict.items() instead of dict.iteritems() iteritems() was removed in python3, so you can’t use this method anymore. Take a look at Python 3.0 Wiki Built-in Changes section, where it is stated: Removed dict.iteritems(), dict.iterkeys(), and dict.itervalues(). Instead: use dict.items(), dict.keys(), and dict.values() respectively.

SyntaxError: non-default argument follows default argument

Let me clarify two points here : Firstly non-default argument should not follow the default argument, it means you can’t define (a = ‘b’,c) in function. The correct order of defining parameter in function are : positional parameter or non-default parameter i.e (a,b,c) keyword parameter or default parameter i.e (a = ‘b’,r= ‘j’) keyword-only parameter i.e (*args) var-keyword parameter i.e (**kwargs) … Read more

Error after upgrading pip: cannot import name ‘main’

You must have inadvertently upgraded your system pip (probably through something like sudo pip install pip –upgrade) pip 10.x adjusts where its internals are situated. The pip3 command you’re seeing is one provided by your package maintainer (presumably debian based here?) and is not a file managed by pip. You can read more about this on pip’s issue tracker … Read more