library issue related to conda environment not active - anaconda

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 ?

Related

Conda create and conda install

I have used anaconda and miniconda without problem before so I don't know why I am having doubts now about the order to use them as
create an environment with conda create
Activate the environment with conda activate
Install packages with conda install
However, lately I have read one set of instructions in which they do a different order: 1->3->2. That means installing without activating and then activating.
Is this correct? Aren't I installing libraries outside of the environment?
There are multiple ways to create and install packages using conda.
create an environment, activate, install packages
conda create --name env_name python=3.8
conda activate env_name
conda install package_name another_package
create an environment with packages
conda create -n env_name python=3.8 package_name another_package
conda activate env_name
Both methods are correct. In fact, we often use a mix here and there. For example, if I have a project with requirements.txt to be installed with pip but would like it to have pandas and scikit-learn from conda-forge. I will do:
conda create --name ml_api python=3.7 -c conda-forge scikit-learn pandas
conda activate ml_api
python -m pip install -r requirements.txt
At any point, we can add packages in conda environment with
# this will install requests to ml_api env. This can be done at any (env)
conda install --name ml_api requests
# or activate ml_api and install. This will install on activated env
conda activate ml_api
conda install requests
At the end of the day, conda is there to help you. A better flow will depend on your need.
The order you listed them is correct but you only need the conda install packagename before you run the code. So you should first create the conda environment and then activate it. Now when you get ready to run the code the first time, be sure to install your package. This enables you to import the package in your python code.

Spyder not starting AttributeError: module 'asycio' has no attribute 'WindowsSelectorLoopPolicy'

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.

Conda env corrupted

Checked the conda environment using the below command:
> conda info
ERROR: The install method you used for conda--probably either `pip install conda`
or `easy_install conda`--is not compatible with using conda as an application.
If your intention is to install conda as a standalone application, currently
supported install methods include the Anaconda installer and the miniconda
installer. You can download the miniconda installer from
https://conda.io/miniconda.html.
If you had a working version of a conda environment before this error started to occur, you can revert back to that working environment using this command:
conda list --revision
and
conda install --revision [n]
Otherwise, you can try to [re]install conda from the miniconda install web page:

How to solve Anaconda and Conda update NoBaseEnvironmentError?

Anaconda's current version is 1.8.7. Version 1.9.7 is now available but I cannot update it due to this error:
NoBaseEnvironmentError.
For Conda, current is 4.6.1 and error is:
NoBaseEnvironmentError: This conda installation has no default base environment.
I could not find any references online. Looking forward to help on this one!
This does not work for me...
(py3) mac-pro : puiseux$ conda activate base
(base) mac-pro : puiseux$ conda update -n base -c defaults conda
NoBaseEnvironmentError: This conda installation has no default base environment...
run the command:
conda activate base
you will get it

What is the preferred way to install spdlib?

I use homebrew to install packages on my Mac OS High Sierra. However, I encountered a package called spdlib that is not available through homebrew. The package is available as an install through conda using the following (source):
conda install -c rios -c conda-forge spdlib
What is the preferred method of getting spdlib on my machine taking into account I do not want homebrew and conda to confict?
One way would be to install Miniconda.
Create a new environment:
conda create -n myenv python=3.6
activate it:
source activate myenv
with a new conda this should work too:
conda activate myenv
Now, you can install what you need without interfering with your homebrew packages:
(myenv) conda install -c rios -c conda-forge spdlib

Resources