I want to activate a conda env that I had added before. I can see my condo environment when I run
conda info --envs
base * /Users/myusername/opt/anaconda3
/Users/myusername/opt/miniconda3
/Users/myusername/opt/miniconda3/envs/ML_python_scripts_DiaMOND_env
/Users/myusername/opt/miniconda3/envs/ML_env
/Users/myusername/opt/miniconda3/envs/spyder-env
But when I run
conda activate ML_python_scripts_DiaMOND_env
it says it can not find the environment.
Could not find conda environment: ML_python_scripts_DiaMOND_env
You can list all discoverable environments with `conda info --envs`.
it does the same thing with the other environments, it does not matter from any directory I run this commends. I would really appreciate any help.
Related
is there a way to specify for a given python package to install in a given conda env vs. the User's python?
I thought that if I did pip install <package> in a given conda environment, this would make the package accessible in that environment.
If I create a conda environment and install pySankey then do conda list, pySankey won't show but instead be installed in /Users/username/Python/3.7/lib/python/site-packages/
The package installs with "Defaulting to user installation because normal site-packages is not writeable". I looked at other stack posts associated with this, but I'm unclear how to modify ~/.bashrc, since my understanding is that ~/.bashrc is not unique to a conda environment. I also checked the path of the conda environment but there's no local as indicated here.
This has happened to me with a couple different packages (eg these packages do not pip install into the conda environment, other do), I'm using pySankey as an example.
thanks!
I have multiple environments under my conda management, as shown below
ss-MacBook-Pro$ conda env list
# conda environments:
#
base * /miniconda2
testenv /miniconda2/envs/testenv
testenvpy3 /miniconda2/envs/testenvpy3
Can I install a package that becomes effective across multiple environments? By reading the documentation, I got the impression that it is NOT possible, because if I do
conda install package-name
it will only get installed into the base environment (the current active environment), but it does not apply to other environments. I remember I can somehow achieve install a package effective to multiple environments under virtualenv before.
Can someone share the suggestion?
conda install only installs packages for the current (activated) environment. Files will be installed in the directory for the specific environment. If you want a specific package in all environments, you'll have to conda install that package for each of your environments (base, testenv, testenvpy3).
To switch between environments you just need to activate the one you switch to. The syntax depends Anaconda version or your OS. For newer Anaconda versions, conda activate <env name> works, and for older versions, source activate <env name> for Unix systems and activate <env name> for Windows.
I'm sure you've looked at this already, but here's a helpful link.
I have successuly installed virtualenv using pip install virtualenv. Then i created a new environment under
(base) C:\Users\xxxxxx\PythonScripts\TwitterTutorial>
using the command virtualenv myenv
then as expected a new environment is created under
C:\Users\xxxx\PythonScripts\TwitterTutorial\myenv
The next step is to activate this environment using this command
(base) C:\Users\xxxx\PythonScripts\TwitterTutorial>.\myenv\Scripts\activate
My issue is that the response is as follows:
(myenv) (base) C:\Users\XXXXXX\PythonScripts\TwitterTutorial>
As you can see, the myenv environment is activated on top of the base one. I found that weird because i expected a response similar to this
(myenv) C:\Users\XXXXXX\PythonScripts\TwitterTutorial>
Maybe the command .\myenv\Scripts\activate is wrong?
On a different note, i have created environments in the past and to activate them i usually do conda activate env and it worked successfully for that particular task (not for this one unfortunately)
Many Thanks for your help
After running conda init from the terminal I am only able to run from the terminal anaconda-navigator from the base environment of anaconda. I want to make it so that I can run anaconda-navigator from any environment including no environment.
I started down this because conda activate myenv would not work. It recommended running conda init; so I did. Previously I could run anaconda-navigator from any anaconda environment and it would pop up but now if I try from anything but base it doesn't work and I get this error message "anaconda-navigator: command not found". However if I enter conda activate into the terminal to bring on the base environment the command works.
I just got done with a clean install of anaconda3 using the recommended steps https://docs.anaconda.com/anaconda/install/linux/
If I delete what conda init added to my .bashrc and add in
export PATH=/home/yourUserName/anaconda3/bin:$PATH
then anaconda-navigator works again from any environement but conda activate myenv stops working.
FYI: I ran conda config --set auto_activate_base False after installing anaconda3
I expect to be able to run anaconda-navigator from any anaconda environment and to be able to use conda activate myenv. Right now I can do one or the other by modifying my .bashrc
On Windows 10 I have Miniconda3 installed under C:/home/miniconda3
I'm using Cygwin (bash shell emulator) and within the Cygwin shell (at the command line) I'm trying to create a virtual environment using conda.
I am creating an environment using conda and it appears to be created OK, however when I activate and then try to use the environment I get an error that appears to show that there's something amiss with the environment that's been created. Here's what I've tried so far:
Start with a fresh Miniconda installation (downloaded and installed today), and list the environments:
$ conda env list
# conda environments:
#
base * C:\home\miniconda3
Create an environment:
$ conda create -n test_env
Solving environment: ...working... done
## Package Plan ##
environment location: C:\home\miniconda3\envs\test_env
Proceed ([y]/n)?
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
#
# To activate this environment, use:
# > activate test_env
#
# To deactivate an active environment, use:
# > deactivate
#
# * for power-users using bash, you must source
#
Display the environments again, showing that the environment was created:
$ conda env list
# conda environments:
#
base * C:\home\miniconda3
test_env C:\home\miniconda3\envs\test_env
Activate the new environment, using source (since Cygwin is running bash). Now when I list the environments I expect to see an asterisk next to the test environment's name, indicating that it's now the active environment, but that's missing:
$ source activate test_env
$ conda env list
# conda environments:
#
base C:\home\miniconda3
test_env C:\home\miniconda3\envs\test_env
At this point I can try using conda commands and they'll all fail since the environment's not being found and/or the environment itself is incomplete/malformed/corrupted:
$ conda list
EnvironmentLocationNotFound: Not a conda environment: C:\home\miniconda3\envs\test_env
$ conda install pandas
EnvironmentLocationNotFound: Not a conda environment: C:\home\miniconda3\envs\test_env
$ conda update pandas
PackageNotInstalledError: Package is not installed in prefix.
prefix: C:\home\miniconda3\envs\test_env
package name: pandas
When I try to deactivate the environment I get the following errors:
$ source deactivate
': not a valid identifierULT_ENV
': not a valid identifier
': not a valid identifierIX
': not a valid identifierPT_MODIFIER
': not a valid identifierON_EXE
Thanks in advance for any suggestions as to what may be going wrong and/or how I can fix this.
Running conda under Cygwin is not fully supported, and the recommended solution for users who want to run conda and associated conda environments in a Linux like shell on Windows is to use the bash shell that comes included with the git client for Windows