Anaconda / Python: Change Anaconda Prompt User Path
Asked Answered
P

8

51

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)]
Pennywise answered 17/1, 2018 at 15:14 Comment(0)
K
26

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.

Kucik answered 17/6, 2020 at 12:16 Comment(0)
O
79

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.

Oquinn answered 17/1, 2018 at 15:19 Comment(2)
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.Snub
Another footnote: this also requires admin privileges so forget it if you are working on your business laptop.Albanian
K
26

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.

Kucik answered 17/6, 2020 at 12:16 Comment(0)
R
11

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

cd C:\Users\u354590

cd means Change Directory.

Retention answered 6/4, 2018 at 22:1 Comment(3)
A bit late, but the OP was asking about changing the default working directory for Anaconda, not how to get to the folder manually.Hemato
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 @Retention 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.Kampmann
As a note, this only worked for me if entered into the Anaconda Powershell {rompt (windows).Crossly
K
11

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://mcmap.net/q/73574/-command-prompt-won-39-t-change-directory-to-another-drive

Kulda answered 7/9, 2022 at 6:27 Comment(0)
P
4

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.

Parimutuel answered 14/11, 2020 at 14:20 Comment(0)
E
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
Elohim answered 24/7, 2020 at 7:19 Comment(1)
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)Parvati
S
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

Shakira answered 9/6, 2021 at 4:45 Comment(0)
S
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

Selfevident answered 14/9, 2021 at 18:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.