python 3.6) environment with the same name. Upgrading conda install python=3.6 may work, but it might not if you have packages that are necessary, but cannot be uninstalled.Īnaconda uses a default environment named base and you cannot create a new (e.g. But you will require to know path of cmd.exe and activate.bat PS:It is not required to find Anaconda Prompt and can be done by changing target of any shortcut. Also you can set the default folder by filling Start in form of the Properties window One advantage of this method is that you can create a few shortcuts each having different environment as default environment. This shortcut you can keep in start menu or pinned in taskbar. Now myenv_prompt will act as shortcut to start cmd with myenv as the default environment for python. fill the Target form something like %windir%\system32\cmd.exe "/K" C:\Users\xxx\AppData\Local\Continuum\Miniconda3\Scripts\activate.bat C:\Users\xxx\AppData\Local\Continuum\Miniconda3\envs\myenv \acitvate.bat with environment 3).\Miniconda3\Ĭhange 3rd part to path of the environment (say myenv) you want as default i.e. There are three parts of this command 1)start. The Target form of Properties window should already be filled with text, something like %windir%\system32\cmd.exe "/K" C:\Users\xxx\AppData\Local\Continuum\Miniconda3\Scripts\activate.bat C:\Users\xxx\AppData\Local\Continuum\Miniconda3\ Right click myenv_prompt and select properties in the context menu. Under Linux there is an easier way to set the default environment by modifying ~/.bashrc or ~/.bash_profileĪt the end you'll find something like # added by Anaconda 2.1.0 installerĮxport PATH="~/anaconda/envs/python3/bin:$PATH"įor windows Anaconda comes with Anaconda Prompt which is a shortcut to cmd and can be used run conda commands without adding anaconda in PATH variable.įind the location of it, copy and rename the copy (say myenv_prompt). Key: HKCU\SOFTWARE\Microsoft\Command Processor Configure it to be started automatically whenever you open cmd."my_conda.cmd", put it in the Application Data folder. The result shows that I'm using my p3.5 environment by default.Ĭreate a command file (.cmd) with activate environment_name and follow these instructions to have it execute whenever you open a command prompt Type the following to see what environment is active Go to end of file and type the following, where "p3.5" is my environment: In Mac OSX this is ~/.bash_profile, in other environments this may be ~/.bashrc The following assumes environment_name is the name of your environmentĮdit your bash profile so that the last line is source activate environment_name. With this method, you can preserve the versions of python you use in your environments. In this case, you should have a script that sets your default environment. Some people have multiple Anaconda environments with different versions of python for compatibility reasons. If you installed packages with pip, you'll have to reinstall them. If it is not possible (e.g., because some package is not built for Python 3.5), it will give you an error message indicating which package(s) caused the issue. This will attempt to update all your packages in your root environment to Python 3 versions. However, if you really want to change the Python version in the default environment, you can do so as follows:įirst, make sure you have the latest version of conda by running conda update conda Typically it's best to just create new environments. To change permanently, there is no method except creating a startup script that runs the above code. (you can create environment-name with `conda create) If you just want to temporarily change to another environment, use source activate environment-name
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |