I want to change active environment to cassandra but conda activate command seems to not work:
PS C:\Users\kordi\edek> conda info --envs
# conda environments:
#
C:\ProgramData\Anaconda3
base * C:\Users\kordi\anaconda3
cassandra C:\Users\kordi\anaconda3\envs\cassandra
PS C:\Users\kordi\edek> conda activate cassandra
PS C:\Users\kordi\edek> conda info --envs
# conda environments:
#
C:\ProgramData\Anaconda3
base * C:\Users\kordi\anaconda3
cassandra C:\Users\kordi\anaconda3\envs\cassandra
I've found solution to this problem.
Conda must be first initialized for use with powershell with:
conda init powershell
Related
When I try to activate my conda environment. I receive the following error:
conda create --name env_test python=3.9.7
conda activate env_test
source $IDPROOT/bin/activate
Could not find conda environment: libigdrcl.so
I am using conda version 22.11.1
Any suggestions on how to resolve ?
[zhuguowei#ecs-299060 ~]$ conda -V
conda 22.9.0
[zhuguowei#ecs-299060 ~]$ conda info --envs
# conda environments:
#
base /data/anaconda3
paddlenlp /data/anaconda3/envs/paddlenlp
ocr /home/zhuguowei/.conda/envs/ocr
[zhuguowei#ecs-299060 ~]$ conda activate ocr
(ocr)
(ocr)
(ocr) conda deactivate
why after activating, only (ocr), I think it should be (ocr) [zhuguowei#ecs-299060 ~], and cannot deactivate it, it is blocked here.
I try to create a new anaconda environment inside docker. I get an error message I cannot get rid of. What I do in my Dockerfile is:
FROM postgis/postgis:12-master
ENV BAG_ENV=bag
RUN wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh --quiet -O /tmp/anaconda.sh
RUN /bin/bash /tmp/anaconda.sh -b -p /opt/conda
RUN conda update conda
RUN conda init bash
RUN . /opt/conda/etc/profile.d/conda.sh
RUN conda create --name $BAG_ENV --force -y python=3.8.2 pip conda libxml2 lxml gdal psycopg2
RUN conda activate $BAG_ENV
I have the same error when running similar instructions from a bash script. The error I get is:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
From this link I learned to source conda.sh. This works for my bash script but not in my Dockerfile. How can I solve this problem?
I run this from an Ubuntu 20.04 machine, the Dockerfile is derived from alpine.
I activate my environment and launch from the conda command line
> activate myenv
> spyder
but I get this error:
Please help
I had to remove my environment conda remove -n envname --all and then conda create -n envname followed by activate envname then conda install -c anaconda spyder.
Seems that there is an issue with my old environments and a recent update I performed.
Now I have to just install the rest of the packages into this environment as clone from previous one wont even allow spyder4 to be installed.
If I list my python environments I get a number of unnamed or nameless environments:
(base)$ conda env list
# conda environments:
#
/Users/drf/anaconda
/Users/drf/anaconda/envs/arc
/Users/drf/anaconda/envs/grids
/Users/drf/anaconda/envs/junk
/Users/drf/anaconda/envs/msr
/Users/drf/anaconda/envs/py27
base * /Users/drf/anaconda/envs/py37
/Users/drf/anaconda/envs/pygridgen
/Users/drf/anaconda/envs/pynomo
/Users/drf/anaconda/envs/python3
/Users/drf/anaconda/envs/pytides
/Users/drf/anaconda/envs/pytides3
/Users/drf/anaconda/envs/wxpython
(base)$
I can activate them with their path names, but I can't use shortnames to activate them:
(base) $ conda activate base
(base) $ conda activate /Users/drf/anaconda/envs/arc
(arc) $ conda activate /Users/drf/anaconda/envs/grids
(grids) $ conda activate /Users/drf/anaconda/envs/junk
(junk) $ conda activate /Users/drf/anaconda/envs/msr
(msr) $ conda activate /Users/drf/anaconda/envs/py27
(py27) $ conda activate /Users/drf/anaconda/envs/py37
(py37) $
But I cannot use the shortnames:
(msr)$ conda activate msr
Could not find conda environment: msr
You can list all discoverable environments with `conda info --envs`.
Where are the short names stored and how do I get their utility back?
Make sure you deactivate the activated environments. If you create multiple environments and activate them, they act as child processes and won't recognize the changes in the parent.
I had the same problem when I upgraded conda and anaconda. You need to add the path to your environments using:
conda config --add envs_dirs <path to envs>
For example, after I upgraded I got the following:
(base) $ conda info --envs
# conda environments:
#
/Users/mah/anaconda
/Users/mah/anaconda/envs/ase3
base * /Users/mah/opt/anaconda3
Note that my old environments were in /Users/mah/anaconda… whereas my new install is expecting the environments to be in /Users/mah/opt/anaconda3. The solution in this specific case was:
(base) $ conda config --add envs_dirs /Users/mah/anaconda/envs
(base) $ conda env list
# conda environments:
#
/Users/mah/anaconda
ase3 /Users/mah/anaconda/envs/ase3
base * /Users/mah/opt/anaconda3