lateinit property envs has not been initialized
Answered
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 ?
Post is closed for comments.
Hey,
Usually, this signifies that conda has initialization problems.
If you haven't initialized conda, run
conda initin 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 initagain.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.
The conflict issue between the latest version of PyCharm and Anaconda still exists, and the specific replication method is as follows:
1. download and install conda;
2. open the pycharm and add new interpreter, then, everything seems fine.
however,
3. please update conda using the following command in your terminal:
conda update --all
4. reopen your phcharm, and try to add a new interpreter, …..
Then you will discover a tragedy
Anyone else can fix the problem ? Thank you
Qingkai Zhen, I wasn’t able to reproduce this behavior following the steps you provided - after running
conda update --all, the conda interpreter can be created without any issues.Does the problem still persist in the latest 2025.2.4 version? If so, please create an issue on YouTrack: https://youtrack.jetbrains.com/issues/PY and attach all relevant details, including the IDE logs collected via Help | Collect Logs and Diagnostic Data, so we can investigate it more efficiently.
I have the same issue after performing conda update --all in PyCharm 2025.2.4
I have also the same issue after installing PyCharm 2025.2.4 on a new (Windows 11) machine where I have only one (mini) Conda version installed and no other Python distrib installed on this machine, the base environment using Python 3.14. I had a PyCharm version running successfully (but quite old) on my previous (Windows) machine.
My Conda installation is working well on the new machine, both from Powershell and from Git Bash so the problem really seems to be in PyCharm. The Conda Python seems correctly detected by PyCharm as it is the installer proposed to create a new Virtualenv…
Is the problem linked ot Python 3.14 ? If I try to create a new Conda env from PyCharm, it allows me to select the Python version up to 3.13 only…
Jouvin, please try updating to the most recent 2025.2.5 version and check whether the issue persists. If it does, please create a YouTrack issue at https://youtrack.jetbrains.com/issues/PY and attach all relevant details.
Thanks. I just upgraded, no improvement. I double-checked my Python version in base environment and it is 3.13, not 3.14. I also tested created a new Conda environment and it worked. I'm opening an issue.
Is it possible that this problem has been created due to an incompatibility with the latest version of Conda? I get the same error (lateinit property envs_dirs has not been initialized, clicking on “Reload environments”) and I am running the latest PyCharm (2025.2.5) with the latest version of conda 25.11.0 when I try to add an existing Conda environment.
Pchilds, can you please check if the issue persists in the latest Release Candidate version?
I'm not Pchilds, but I just tested the RC and that seemed to have solved the problem.
I switched to the latest RC and it is working somewhat better. There are some other issues with RC. I will comment tomorrow when I am work. Thanks for following up Mikhail.
An issue with the RC is that I could not import a module in the root of my project into a Jupyter notebook unless I added the path to the project to the pythonpath.
project_path = r"C:\path\to\project"
sys.path.append(project_path)
The notebook is also in the project but in a subfolder. This did not have to be done in previous versions of PyCharm.
Pchilds, thank you for the update!
Since the behavior you described is not related to the original issue in this thread, could you please create a separate YouTrack issue at https://youtrack.jetbrains.com/issues/PY
Hi all here is the solution I found
When selecting the Conda path in PyCharm, choosing
D:\Miniforge-xxx\Scripts\conda.exe doesn’t get recognized —
it pops up an error:
"lateinit property envs_dirs has not been initialized"
But when selecting
D:\Miniforge-xxx\_conda.exe,
PyCharm can detect the environments — except the first environment it lists is some “ghost thing” inside the Temp folder on the C drive.
How could I possibly have created an environment there?!
Regarding this point, OpenAI explained that:
Alright ~_~, regardless of that, my real goal is simply to:
Now, who can solve this? 🙋🏻♂️🤔🧐…
Author: emm Hi
Link: https://leetcode.cn/discuss/post/3846146/guan-yu-jin-qi-zai-pycharmzhong-shi-yong-tcg3/
Source: LeetCode
© The original author. For commercial use, please contact the author. For non-commercial use, please credit the source.
cc: Pchilds
conda version : 25.11.0
select miniconda/_conda as conda, not bin/conda, it`s ok.
Changing the Conda path worked! Thanks, bro.
have the same issue
when running the latest PyCharm (2025.2.5) with the latest version of conda 25.11.0
PyCharm (2025.2.5), conda 25.9.1 works
I concur with Nan0606
same PyCharm and conda (from Miniforge) version.
Working on ARM Macbook with MacOS Sonoma
Hi everyone! It looks like you're encountering a known issue PY-85954, which is expected to be fixed in the upcoming release.
In the meantime, you can install the latest Release Candidate version, as a temporary workaround until the final release becomes available.
Hello everyone, I just encountered the same issue and I have found the method to solve it! When adding interpreter, choose system interpreter instead of conda environment, and it will done.
Same here. Conda 25.11.1 on Ubuntu. Works in terminal but PyCharm can't load envs, and throws `lateinit property envs_dirs has not been initialized`.
Xijun Sun, as a general troubleshooting step, please try updating to the latest 2025.3.1 version and check whether the issue persists.