I've configure emacs to write python code and I love it!:). It works very well but after some situations that I cannot understand the autocomplete stops working on all buffers. If I restart emacs it works again.
Sorry for the vague question but maybe some emacs expert can figure it out by looking at my init.el file.
Thanks in advance! :)

Welcome to Stack Exchange! You're more likely to get an answer to your question if you follow this guide about asking questions: stackoverflow.com/help/how-to-ask For example, to format your code snippets, highlight the code and press "Ctrl+k".
– Lorem IpsumJan 14 at 13:23

That being said, I sometimes have difficulty with autocomplete in company-mode. Emacs hangs while it looks for possible completions. In such a scenario, you can interrupt the search process with repeated cancel commands, C-g.
– Lorem IpsumJan 14 at 13:24

1

Ok thanks for the posting suggestions! C-g didn't work but I found out that it was an rpc issue that many have experienced. For now I do elpy-rpc-restart and suggestions start to appear again. I will still investigate and if I find a proper solution I will post it there
– Marco GabaglioJan 14 at 15:21

There is the (elpy-config) command which shows the current elpy configuration. Check that. I notice that you're enabling elpy before activating the virtual environment. It might be that elpy is pulling from the system install rather than the virtual environment. You might try doing those in reverse order; do the pyenv-activate before the elpy-enable.
– Lorem IpsumJan 14 at 15:28