lateinit property envs has not been initialized
I'm running PyCharm 2024.2.3 (Professional Edition).
I'm setting up a pixi environment. I've installed python==3.12 and pixi-pycharm.
Now, I'm trying to configure the python interpreter using Settings | Python Interpreter | Add Interpreter | Add Local Interpreter | Conda Environment. Then I get the message “lateinit property envs has not been initialized”.
All of my code is in Python. There is no Kotlin code in my project.
Any ideas what I'm doing wrong ?
Please sign in to leave a comment.
Hey,
Usually, this signifies that conda has initialization problems.
If you haven't initialized conda, run
conda init
in the terminal.If you did it earlier, but conda was reinstalled, or other conda distribution was installed - try running
conda init --reverse
, restart PC, and runconda init
again.I followed your three steps, but still get the same error.
Is there a file that is causing PyCharm to look for "lateinit envs"
upload id = Upload id: 2024_10_23_xqZBfavtuBLXq87URabdzN (file: idea.log)
I'm still unable to reproduce the issue, and the logs, unfortunately, don't provide any additional clues.
Could you please check if conda envs works correctly without pixi?
I uninstalled PyCharm (Professional) and reinstalled it using JetBrains Toolbox. But still get the same problem.
I will note that this happens regardless of the project. So it doesn't appear to be related to the project's directory contents. I believe this must be a problem with the common PyCharm installation – probably directory contents.
Then I blew away my miniconda envs and recreated a couple of simple ones. Then I reinstalled conda.
Still same problem.
What's the next step? I'm unable to separate my environments in PyCharm now.
If the lateinit is done inside PyCharm code, then I won't be able to fix it externally.
If the lateinit is done from a file, then it is probably a problem with some file on my system. But I don't know which file that might be.
FYI. I found that I had both conda and anaconda installed. When I deleted the anaconda installation (which was pretty old), things started working again.
Probably, the problem was with the initialisation/uninitialisation; two conda instances on one machine simultaneously seem very controversial taking into account how conda init works.