All Projects → BCSharp → PSCondaEnvs

BCSharp / PSCondaEnvs

Licence: MIT license
Implementation of Conda's activate/deactivate functions in Powershell.

Programming Languages

powershell
5483 projects
Batchfile
5799 projects
shell
77523 projects

Projects that are alternatives of or similar to PSCondaEnvs

pytorch-aarch64
PyTorch wheels (whl) & conda for aarch64 / ARMv8 / ARM64
Stars: ✭ 137 (+63.1%)
Mutual labels:  anaconda, conda
FreeCAD Conda
conda recipes for freecad and dependencies of freecad
Stars: ✭ 35 (-58.33%)
Mutual labels:  anaconda, conda
conda-devenv
A conda tool to work with multiple projects in development mode.
Stars: ✭ 95 (+13.1%)
Mutual labels:  anaconda, conda
docker-alpine-miniconda3
The smallest Docker image with Miniconda3 (Python 3.7) (~143MB)
Stars: ✭ 94 (+11.9%)
Mutual labels:  anaconda, conda
Cs231n
My Solution to Assignments of CS231n in Winter2016
Stars: ✭ 71 (-15.48%)
Mutual labels:  anaconda
Cudf
cuDF - GPU DataFrame Library
Stars: ✭ 4,370 (+5102.38%)
Mutual labels:  anaconda
Deep Learning Keras Tensorflow
Introduction to Deep Neural Networks with Keras and Tensorflow
Stars: ✭ 2,868 (+3314.29%)
Mutual labels:  anaconda
a-minimalist-guide
Walkthroughs for DSL, AirSim, the Vector Institute, and more
Stars: ✭ 37 (-55.95%)
Mutual labels:  anaconda
Setup Miniconda
Set up your GitHub Actions workflow with conda via miniconda
Stars: ✭ 222 (+164.29%)
Mutual labels:  anaconda
Anaconda Project
Tool for encapsulating, running, and reproducing data science projects
Stars: ✭ 153 (+82.14%)
Mutual labels:  anaconda
Pqg Pytorch
Paraphrase Generation model using pair-wise discriminator loss
Stars: ✭ 33 (-60.71%)
Mutual labels:  anaconda
Notes Python
中文 Python 笔记
Stars: ✭ 6,127 (+7194.05%)
Mutual labels:  anaconda
Memex Explorer
Viewers for statistics and dashboarding of Domain Search Engine data
Stars: ✭ 115 (+36.9%)
Mutual labels:  anaconda
Yellowbrick
Visual analysis and diagnostic tools to facilitate machine learning model selection.
Stars: ✭ 3,439 (+3994.05%)
Mutual labels:  anaconda
Anaconda
Anaconda turns your Sublime Text 3 in a full featured Python development IDE including autocompletion, code linting, IDE features, autopep8 formating, McCabe complexity checker Vagrant and Docker support for Sublime Text 3 using Jedi, PyFlakes, pep8, MyPy, PyLint, pep257 and McCabe that will never freeze your Sublime Text 3
Stars: ✭ 2,128 (+2433.33%)
Mutual labels:  anaconda
dbcollection
A collection of popular datasets for deep learning.
Stars: ✭ 26 (-69.05%)
Mutual labels:  anaconda
Crime Analysis
Association Rule Mining from Spatial Data for Crime Analysis
Stars: ✭ 20 (-76.19%)
Mutual labels:  anaconda
Ml Workspace
🛠 All-in-one web-based IDE specialized for machine learning and data science.
Stars: ✭ 2,337 (+2682.14%)
Mutual labels:  anaconda
Vds
Verteego Data Suite
Stars: ✭ 9 (-89.29%)
Mutual labels:  anaconda
Elyra
Elyra extends JupyterLab Notebooks with an AI centric approach.
Stars: ✭ 839 (+898.81%)
Mutual labels:  anaconda

PSCondaEnvs

Implementation of Conda's activate/deactivate functions in PowerShell. Works on Windows, macOS, Linux. Works with PowerShell 2.0 and up. Works with Conda from 4.1 up to 4.5. Conda 4.6 introduced native support for PowerShell. If you have Conda 4.6.0 or higher, run conda init --help for more info.

Quick Install

Open a Powershell or Command Prompt session, and enter the following command:

conda install -n root -c pscondaenvs pscondaenvs

Done! Note, you may need to change the Powershell Execution-Policy to RemoteSigned in order for this package to work (see caveats below for more details).

In case of any issues, first update to the latest version:

conda update -n root -c pscondaenvs pscondaenvs

If the problem persists, file an issue report on GitHub.

Manual Install

If you want to install manually for some reason, copy activate.ps1, deactivate.ps1 and invoke_cmdscript.ps1 into your Anaconda\Scripts directory (Windows) or activate.ps1 and deactivate.ps1 to anaconda/bin directory (macOS, Linux).

Usage

Simply use the activate and deactivate commands as normal:

PS C:\> activate TestEnv
(TestEnv) PS C:\> deactivate

For fine control of activation of an individual environment, activate.ps1 will execute both .ps1 and .bat scripts in etc\conda\activate.d\ in the target environment just as activate.bat would do with .bat scripts. Similarly, deactivate.ps1 exetutes sctipts in etc\conda\deactivate.d\

For more help:

PS C:> help activate.ps1

Caveats

  • Activate.ps1 uses internal conda commands ..checkenv and ..activate (just as activate.bat does). Things may stop working when conda changes the semantics of those commands. Also, older versions of conda (probably) do not support those commands.
  • The names of the scripts do not follow established PowerShell naming convention. Probably more appriopriate names for the sctipts would be Enable-CondaEnv/Disable-CondaEnv, or, even better: Enter-CondaEnvironment/Exit-CondaEnvironment (the verbs enable/disable are meant for lifecycle management). Long, but then again: New-Alias is your friend.
  • activate and deactivate Powershell Aliases are automatically added when you first activate your environment. This is to override any activate/deactivate.bat or .activate/deactivate.sh files that appear in your individual environment's binary path, that would normally execute instead.
  • You might not be allowed to execute the PowerShell scripts due to your systems execution policies. The default execution policy on Windows is 'Restricted', which does not allow execution of any scripts. The default execution policy on Linux and macOS is 'Unrestricted', which allows execution of any script. A simple, though reducing system security, way to enable execution of activate.ps1/deactivate.ps1 on Windows is to allow the execution of all local scripts unconditionally and all signed scripts that originate from remote locations. This can be done by running the following command from an Admin-Powershell: Set-ExecutionPolicy RemoteSigned. An alternative and more secure option is to use Set-ExecutionPolicy AllSigned, in which case both local and remote scripts have to be signed to be executable, however in this case, since all scripts from PSCondaEnvs are unsigned, you will have to sign them yourself with a valid cetificate. You may need to restart any open Powershell sessions for the change to take effect. Verify the changes by running Get-ExecutionPolicy.
  • Some execution environments (e.g. Cmder) make the Powershell prompt function read-only. PSCondaEnvs normally modifies the prompt function to display the name of the currently active Conda environment, but if the prompt function is set to read-only, PSCondaEnvs will leave it unmodified. In such case, to show the name of the active environment, the prompt function has to be adapted by the user. For instance, if using Cmder, edit the file $Env:CMDER_ROOT\config\user_profile.ps1 and change the definition of $PrePrompt to something like:
[ScriptBlock]$PrePrompt = {
    if ($Env:CONDA_DEFAULT_ENV) {
        return "($Env:CONDA_DEFAULT_ENV) "
    }
}

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].