I have Anaconda installed on a server. I have a conda environment on a NAS. The conda environment is not visible to the Anaconda installation, because it was created with a different installation on a different server.
Is it possible to "create" a conda environment from my Anaconda installation that would actually bypass creation and just point to the existing environment on the NAS? This would be similar to using the --fake method in Django to connect to existing tables when a model is migrated.
You can either add the location of the directory containing the environments to your conda config, which tells conda where to "look" for environments, or you can just activate the environment directly by passing the path.
Assuming your your NAS is mapped to a drive letter (such as Z:) and your conda environment is located at Z:/conda/envs/my_env, then you can add that location to your conda configuration via:
conda config --append envs_dirs Z:/conda/envs
Now when you can activate the environment using:
conda activate my_env
If you have another environment named my_env in a different directory, it will be first in the order.
Alternatively, you can activate the environment directly by passing the path.
conda activate Z:/conda/envs/my_env
Related
I am using Visual Studio Code and have Anaconda downloaded so i selected it as my path interpreter.
I am able to download virtualenv using pip install virtualenv and then instantiate it using virtualenv env.
The issue occurs when I try to activate the environment using activate env or conda activate env.
Error message returned: Could not find conda environment: env. I then proceeded to look into my directory and I see that the environment is included as a folder so I'm confused on why I cannot activate it. For reference I am using Windows.
Edit: Originally the environment was not appearing in my users/.conda/environments file but using conda create --name venv I was able to create a new environment here. However, it doesn't instantiate in my current directory. Thoughts?
conda virtual environments are not interchangeable with virtualenv virtual environments. If you have created a virtual environment in your current dir. The ps command would be .\Scripts\activate
I am about to program 2 different python projects on my computer, each of them is using a different version of a specific module (PyTorch), as well as modules from the latest anaconda.
I have already installed anaconda and found out that the solution is a virtual environment, however, I don't want to install all anaconda modules for each one of them, but use the already installed anaconda for both of them.
How do I do it?
You can use virtual environment which allows you to install specific packages (with specific version) and/or specific python version.
From the docs,
To create virutal environment called myenv
conda create -n myenv
# Create with specific python version
conda create -n myenv python=3.6
# Create with specific version of python and package
conda carete -n myenv python=3.5 pytorch=1.2
To use a virtual env, you have to activate it.
# Activating myenv
conda activate myenv
To deactivate a env, and fall back to default anaconda env,
# myenv
conda deactivate
conda activate base
# Anaconda default env is called base
To list available virtual env
conda env list
or
conda info --envs
Problem
I am trying to create a virtual environment for my deep learning project. However, after I created and activated the environment called venv using the following commands
conda create -n venv anaconda
conda activate venv
I found that many of the deep learning packages were not shipped with this virtual environment (the left panel is conda list outside the virtual env while the right panel is the one inside).
I noticed that packages not imported has "channel" property called conda-forge or pytorch
Therefore, I am wondering how could I create an virtual environment that copies all packages rather than that only have native packages. Thank you in advance!
why dont you export the results of conda list into a text file, then make a new venv using this text file:
conda list --export > requirements.txt
conda create -n new --file requirements.txt
I think you can also do this, but haven't tested:
conda create -n new --clone base
I am trying to create a new empty evironment with conda using the command:
conda create -n name python=3.6
Then I activate the environment and export it with
conda env export > environment.yml
I have noticed that the generated yml files contains a lot of pip packages that I guess are installed system wide. I am a ROS user and all the python packages installed by ROS appear there. Is there a way to ensure that those pip packages are not included in my new environment?
Thanks a lot for your help.
Make sure that you created the environment not using
conda env create -n name python=3.6
but using instead the command
conda create -n name python=3.6
Using the first command will link all packages from your base environment.
Also note that your new environment will contain several default packages (such as Python 3.6, pip, etc.) if you use the flag python=3.6 when creating the environment.
I am using Anaconda in a server. The environment default is c:\anaconda.
I have no admin privilege, so I cannot apply 'conda install gdal'.
The program suggests cloning the environment.
I have cloned it.
When I type
conda env list
My environment is shwon correctly.
However, when I
deactivate
And try to
activate mine
Conda says there is no such environment...
Anybody?
Thanks.