Skip to content

Commit

Permalink
edit conda env
Browse files Browse the repository at this point in the history
  • Loading branch information
krother committed Oct 15, 2023
1 parent a24824b commit c9a9911
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
8 changes: 2 additions & 6 deletions version_control.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Set up a Git Repository
# Set up a Repository on GitHub

Version Control is in my opinion the single most important tool of modern software development.
Most of the time, using Version Control means using **git**.
Expand Down Expand Up @@ -45,7 +45,7 @@ The Private/Public setting is easy to change later on as well.

This is a no-brainer. Tick this box.

### Step 4: Add a .gitignore
### Step 4: Add a .gitignore file

The `.gitignore` file prevents that many types of temporary or auto-generated files are added to your repository.
It is another must-have.
Expand Down Expand Up @@ -74,7 +74,6 @@ The dialog should look similar to this:
Press the **Create Repository** button.
After a few seconds, you should see a page listing the files in your new project repo:

:::text
.gitignore
LICENSE
README.md
Expand All @@ -100,7 +99,6 @@ Do the following:

You should see a message similar to:

:::text
kristian@mylaptop:~/projects$ git clone git@github.com:krother/snake.git
Cloning into 'snake'...
remote: Enumerating objects: 5, done.
Expand All @@ -111,7 +109,6 @@ You should see a message similar to:

There also should be a new folder:

:::text
kristian@mylaptop:~/projects$ ls -la snake
total 24
drwxrwxr-x 3 kristian kristian 4096 Mai 28 11:33 .
Expand All @@ -128,7 +125,6 @@ Now you can start adding code to your repository.
For instance you could add a prototype if you have one.
The sequence of commands might look like this:

:::bash
cd snake/
cp ~/Desktop/prototype.py .
git status
Expand Down
16 changes: 5 additions & 11 deletions virtualenv.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,17 @@ If you haven't installed Anaconda already, you can find the **Miniconda installe

----

## How to set up a project with virtualenv?
## How to set up a project with conda?

Once the installer finishes and you open a new terminal, you should see `(base)` before the prompt:

:::bash
(base) ada@adas_laptop:~$

This means you are in an virtual environment called *"base"*.

Let's create a new one for a project that requires the **tqdm** package:
Let's create a new one for a project called **snake**, specifying a Python version:

:::bash
conda create -n tqdm
conda create -n snake python=3.11

Behind the scenes **conda** creates a new subdirectory.
This is where libraries for your project will be stored.
Expand All @@ -44,25 +42,21 @@ There are also scripts to activate the environment.

To start working with your project, type:

:::bash
conda activate myproject
conda activate snake

You should see a *(myproject)* appearing at your prompt.
You should see a *(snake)* appearing at your prompt.
Now, whenever you use *pip* to install something, it will be installed only for *myproject*.

Now check which libraries you have installed:

:::bash
pip freeze

You can install additional libraries with `pip` or `conda`:

:::bash
conda install pandas

When you want to switch back to the base environment, type:

:::bash
conda activate base

The virtual environment is specific for a terminal session. Thus, you can work on as many projects simultaneously as you have terminals open.

0 comments on commit c9a9911

Please sign in to comment.