0

When using conda env list to look up the environment list, I found two environments with same name. I think it's the problem why my vscode has the 'Import [module] could not be resolved Pylance(reportMissingImports)' error. But actually the code could run since I did install the package in the environment. How can I deal with it? It seems the two Pytorch enviroments only have the difference of the 'D:' or 'd:', but in anaconda there is only one Pytorch.

# conda environments:
#
base                     D:\anaconda3
Pytorch               *  D:\anaconda3\envs\Pytorch
Pytorch                  d:\anaconda3\envs\Pytorch


Import torch could not be resolved Pylance(reportMissingImports)

How to delete the second Pytorch and bring my vscode to normal?

  • Here is how to remove a conda env: https://stackoverflow.com/questions/49127834/removing-conda-environment – Christoph Fischer Dec 07 '22 at 08:50
  • But the two environment have the same name. Wouldn't it delete my normal environment? – Vincent Wan Dec 07 '22 at 08:54
  • Please elaborate on how exactly this *"results in chaos"*? Right now, this looks like an inconsequential bookkeeping issue. Namely, whenever a `conda activate` command is used, the environment is recorded in `~/.conda/environments.txt`. In a non-case-sensitive filesystem, one could `conda activate d:\AnAcOnDa3\ENVS\PyTOrch` and it would add this to the list. Probably can just edit the `environments.txt` to make it go away, but even without that, there is still only one environment named `Pytorch`. – merv Dec 07 '22 at 19:14

1 Answers1

-2

Just keep write

anaconda3\envs

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 09 '22 at 17:05