Broke my conda installation permanently by adding environment variable - python

I used Conda on Windows and tried and set an environment variable using the command
conda env config vars set value=x
I used this command incorrectly resulting in a behaviour documented here:
How to clear the conda environment variables?
This broke my Conda completely and I could no longer activate or deactivate environments.
I then decided on the smart idea to just start with a fresh install of conda.
I ran the windows uninstaller and received the following error message.
On reinstalling miniconda or anaconda I get no error messages but basically I cannot use conda in powershell or cmd. I also cannot open the anaconda command terminal. when opening it just closes immediately with no error message.
Any help on how to fix this would be greatly appreciated I now understand I didn't really know what adding an environment variable did. Is it possible this variable is saved somewhere else and is stopping anaconda from working properly?
thank you

Related

Why aren't conda commands working in Spyder?

I recently downloaded Spyder using Python 3.9.12. For some reason, every time I try to use a conda command (such as conda activate env), the Spyder terminal gives the message 'Note: you may need to restart the kernel to use updated packages.' I've restarted the kernel multiple times, but the same message persists, essentially meaning that I cannot use conda commands in Spyder. However, they work fine in the regular Anaconda3 prompt. Does anyone know how to fix this? Thanks in advance!

The Conda environment is not activated

I'm learning Python, so I don't know too much about this right now. I just finished installing anaconda, but when I enter python word in the command prompt it give me this error:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment, please see https://conda.io/activation
When I write on cmd -condo activate base- and try to write Python again, the error disappears, but if I don't do that, it continues showing on cmd when writing the python word. Do I need to do something or is it all right?
If the Python interpreter is a part of a Conda environment then you do need to activate the conda environment in order to use it and that is OK.

How to get rid of (base) environment prefix shown in terminal

I have quite some problems using python on my Mac. I need different versions from 3.5 to 3.7 and multiple packages for data science. Due to various instructions on the web I ended up installing python 3.6 itself, anaconda, pipenv and maybe more stuff I can't even remember.
I suppose there is no other way to eliminate this mess than to format everything and start over. Currently my terminal is showing some sort of prefix for the environment in the terminal. Something like:
(base) user#machine:~$:
How can I at least get rid of this environment prefix? It appeared after installing pipenv, which seems to have taken over my previous anaconda environments. I fear those vanish to when uninstalling pipenv.
The deactivate command alone will get you out of the currently activated virtual environment.
(base) user#machine:~$:
(base) user#machine:~$: deactivate
user#machine:~$:
As far as I know, this works across all operating systems.
Found the problem: Anaconda edited the .bash_profile which gets executed on the mac for each new terminal. I deleted the anaconda entry and the base prefix is gone.
Also, for anyone that is using zsh and Anaconda.
You can remove the entry Anaconda makes from the ~/.zshrc file in addition to the conda deactivate
Conda can be configured with command conda config
This command will remove message about the current environment:
conda config --set changeps1 no
This command will add messages about the current environment:
conda config --set changeps1 yes
https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#change-command-prompt

conda install basemap in python2.7 environment gives Runtime error R6034

This is my first post here, so if I need to give more info, could you ask me?
I installed Anaconda 2018.12 python 3.7 version, adding anaconda to my path environment variable. I made a new environment with "create -n py2.7 python=2.7 anaconda", and installing netcdf4 (conda install -c conda-forge netcdf4) and basemap(conda install -c conda-forge basemap) in the new environment.
However, soon after installing basemap, the command prompt gave Runtime error R6034. Then, the error started to repeat happening even when I just tried "conda list" in the new environment. The base environment seems working fine.
Could anyone help me to solve this issue? I cannot open even spyder in this situation either from start menu or command prompt.
Version: windows10, anaconda 2018-12
The following was what I tried to solve the issue, so far.
I re-installed anaconda multiple times, but it did not work.
Using "Process Explorer" and found msvcr90.dll in folders relating to the python process. Then, changing the name to msvcr90.dll_hihi. I found this way in Youtube, but gave another error: CondaHTTPError: HTTP 000 Connection Failed.
I re-installed without adding anaconda to my path environmental variable. However, this did not work, either.
I am totally confused and so depressed not to be able to use anaconda for my research. I really appreciate it if anyone could help me.
I had a similar problem with Anaconda3 and Python27. I solved this problem via executing the following command in cmd, outside of any conda environment:
conda install msvc_runtime
After installing the packages, open a new command and test if the R6034 error still appears.

conda not recognized in Anaconda Prompt after deactivating environment

Not sure if this is a bug, but if anyone has a suspected way to fix this issue, I would be eternally grateful.
Description
After activating an environment in the Anaconda Prompt, when I deactivate I seem to lose all conda-related information. In other words, it returns me to a normal Windows command prompt. (No Python, no conda commands, etc.) This is rather annoying because it means I need to open another Anaconda Prompt and navigate back to the folder where I was working.
Steps to reproduce:
Create a python environment with Anaconda Prompt
Activate it
Deactivate it
Try conda list
I just had 30 new users install Anaconda with Python 3.6 earlier this week, all on Windows, and they all experienced this issue. I have Miniconda, they have Anaconda.
Config info
platform : win-64
conda version : 4.3.25
python version : 3.6.1.final.0
EDIT: forgot to mention that I submitted a bug report just in case this was a bug. No responses at the moment.
Turns out, my understanding of deactivate was wrong -- it's purpose is to completely deactivate conda and remove all traces from the terminal. So this behavior is what deactivate is actually meant to do, not switch you to your root environment.
See the issue response here: link.
Run in Windows prompt:
cmd "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3
You will have anaconda prompt back.

Categories

Resources