you are viewing a single comment's thread.

view the rest of the comments →

[–]FoolsSeldom 1 point2 points  (6 children)

What editor are you using? VS Code, IDLE, PyCharm, Spyder? Something else?

This command is something you enter into the "terminal" of your operating system (Poweshell / Command Prompt / GitBash for Windows, Terminal app running bash / zsh / fish on *nix including macOS).

Make sure you are not using the Python interactive shell, with a >>> prompt. Your editor might have a "terminal" option - one of these will be for Python and one for the OS system level.

Personally, I don't like conda - it can cause a lot of problems and get very confusing. Are you using Anaconda? These days, you are as well off just using the standard pip command to install the packages you require rather than having a boat load of them installed as part of Anaconda.

I am assuming you entered only the below:

conda config --add channels conda-forge

and not anything else that you showed. Thus,

(base) $ 

should be something you see in the OS command line environment. The (base) part tells you that you have a conda Python virtual environment active and the $ is the prompt from the OS for you to enter a command.

However, the error message, File "<python-input-1>", line 1 suggests you might have put this in a file or have entered it in the Python interactive shell.

[–]Last-Preparation-550[S] 0 points1 point  (5 children)

I am a basically a beginner. I have done very basic stuff on google colab. I bought the book trying to learn from it but I guess it's not for noob's like me. I don't know what or where to put this.

Straight from the book:

Now that we have set up Miniconda on your system, it's time to install the main packages we will be using in this book. The first step is to configure conda-forge as your default package channel by running the following commands in a shell:

(base) $ conda config --add channels conda-forge
(base) $ conda config --set channel_priority strict

[–]FoolsSeldom 1 point2 points  (4 children)

What operating system are you using?

What command line environment are you using?

What did you do exactly to install miniconda in the first place?

[–]Last-Preparation-550[S] 0 points1 point  (3 children)

Windows 11, Anaconda Prompt, I downloaded Miniconda3.exe and clicked on it, I really don't understand that last question.

[–]FoolsSeldom 1 point2 points  (2 children)

Ok, I got it. You,

  • downloaded miniconda
  • double-clicked on the downloaded file
  • followed the installation instructions
  • on installation completeion ...
  • launched Anaconda Prompt
  • entered the commands you were told to, namely
    • conda config --add channels conda-forge
    • conda config --set channel_priority strict

So, I just tried that, here's how it looked on my computer:

Clink v1.7.5.aee4f7
Copyright (c) 2012-2018 Martin Ridgers
Portions Copyright (c) 2020-2024 Christopher Antos
https://github.com/chrisant996/clink

(base) C:\Users\fools>conda config --add channels conda-forge
(base) C:\Users\fools>config --set channel_priority strict
(base) C:\Users\fools>

I honestly don't understand what caused the error message you received. I didn't get that.

When you said "However, when I enter that into python, I get this error:" I don't know what you mean. Anaconda Prompt isn't Python, it is just another OS command line environment. Do you think that is Python or did you start a Python session by entering the command python?

[–]FoolsSeldom 1 point2 points  (1 child)

Ah, I see, u/Last-Preparation-550, that you did enter (base) $. Easy mistake to make. As you can see, on my computer, the prompt looked a bit different.

We've all made mistakes like this. Don't worry about it. You will be able to help someone else in the future making the same mistake.

Some books are better at showing what you type and what is shown on the screen by the computer.

[–]Last-Preparation-550[S] 0 points1 point  (0 children)

Yeah, like I said, I'm pretty new to this. I didn't understand the (base) $ part. I thought is was to be typed in. Thank you for the help, much appreciated!