46

I want to change my Anaconda Prompt User file path. Currently it is as follows:

enter image description here

I want it to change to: C:\Users\u354590

How do I do this?

The current version of anaconda I have is:

Python 3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)]
PineNuts0
  • 4,740
  • 21
  • 67
  • 112

8 Answers8

74

Go to Start and search for "Anaconda Prompt" - right click this and choose "Open File Location", which will open a folder of shortcuts. Right click the "Anaconda Prompt" shortcut, choose "Properties" and you can adjust the starting dir in the "Start in" box.

Nicolas Gervais
  • 33,817
  • 13
  • 115
  • 143
Jonathon McMurray
  • 2,881
  • 1
  • 10
  • 22
  • 7
    Adding to this that if you have Anaconda Prompt on your taskbar prior to the change you might have to unpin it, run from the shortcut with the updated path then pin it back. – Ken Jan 30 '20 at 21:02
  • Another footnote: this also requires admin privileges so forget it if you are working on your business laptop. – baggiponte Nov 23 '21 at 12:30
24

In Windows, if you have the shortcut in your taskbar, right-click the "Anaconda Prompt" icon, you'll see:

  • Anaconda Prompt
  • Unpin from taskbar (if pinned)
  • Close window

Right-click on "Anaconda Prompt" again.

Click "Properties"

Add the path you want your anaconda prompt to open up into in the "Start In:" section.

Note - you can also do this by searching for "Anaconda Prompt" in the Start Menu. The directions above are specifically for the shortcut.

Nigel D
  • 256
  • 2
  • 4
10

If you want to access folder you specified using Anaconda Prompt, try typing

cd C:\Users\u354590

cd means Change Directory.

BenSeedGangMu
  • 211
  • 1
  • 3
  • 10
  • 5
    A bit late, but the OP was asking about changing the default working directory for Anaconda, not how to get to the folder manually. – Schwaitz Dec 22 '18 at 15:54
  • 2
    From my own interpretation of the OP, I couldn't find a concrete indicator that it was about changing the default directory. On the other hand, answer from @BenSeedGangMu is useful for situation where user just simply wants to temporally change anaconda prompt from one directory to another, thus it complemented the main answer. – Nemo Sep 29 '19 at 02:11
  • As a note, this only worked for me if entered into the Anaconda Powershell {rompt (windows). – RegressForward Mar 04 '22 at 18:41
6

We can change drive and directory path by input of following command

cd /d d:\

Explanation : CHDIR [/D] [drive:][path]

cd /?

Main answer source in detail : https://stackoverflow.com/a/44985515/9558119

Sarang Kakkoth
  • 381
  • 3
  • 9
3

Just Type the Drive Location you want to work with: This worked for me! For example you want to change to D drive in windows:

D:\

If you want to change to particular folder in the drive:

cd D:\Newfolder
Bernad Peter
  • 504
  • 5
  • 12
  • 2
    I was not able to use `cd` in Anaconda prompt to change to a directory on a different drive, could only navigate within the drive in which the default path of the prompt is on. (Windows) – TwoFingerRightClick Mar 04 '22 at 05:52
3

In both: Anaconda prompt and the old cmd.exe, you change your directory by first changing to the drive you want, by simply writing its name followed by a ':', exe: F: , which will take you to the drive named 'F' on your machine. Then using the command cd to navigate your way inside that drive as you normally would.

Ahmed Appas
  • 103
  • 1
  • 5
2

Navigating to desired directory using CD is tedious. Anaconda was opening in C:\Windows\System32 folder for me. So I created a batch file called goPy.bat containing the following

cd c:\users\myname\documents\python\scripts
Jupyter Notebook

and saved it in Windows\System32 All I have to do is type in goPy and Jupyter Notebook would open in the desired working directory

Sahir Shah
  • 21
  • 1
1

if you want to change the contents of PATH you are going to have to update the _conda_activate.bat and conda.bat files at this line

@SET PATH=!_sysp!;!_sysp!\Library\mingw-w64\bin;!_sysp!\Library\usr\bin;!_sysp!\Library\bin;!_sysp!\Scripts;!_sysp!\bin;%PATH%

and then you will have to close anaconda prompt and then re-open.

the _conda_activate.bat and conda.bat files are found at %%Users\"user"\anaconda3\condabin