My encountered problems and solutions

This part of blog is dedicated to problems that I run into regularly but not often enough to remember the solutions.

  1. Markdown cheatsheet to make this nice style.

OS, bash, and installation problems and solutions

  1. Cannot uninstall ‘'. It is a distutils installed project and thus we cannot accurately determine which files belong to it and which would lead to only a partial uninstall. This problem occurred while updating [DVC](https://pypi.org/project/dvc/). The fast and easy solution without burden of downgrading pip, resolving it, and upgrading pip back was found on [stackoverflow](https://stackoverflow.com/questions/53807511/pip-cannot-uninstall-package-it-is-a-distutils-installed-project) `pip install --ignore-installed`

  2. screen -S your_name and renaming already existing screen from stackoverflow

2.1. In case screen is bugged and appears as attached but you have no open terminal with this screen

screen -r yourName
There is a screen on:
        8600.yourName      (02/28/2021 01:33:59 PM)        (Attached)
There is no screen to be resumed matching yourName.

Then you can reconnect with screen -D -r yourName

Anaconda

  1. Never use conda base env for conda update -n base conda - it can ruin all conda installation, especially when there are more than one python version installed. (for example python3.7 and python3.8)

Jupyter

  1. Can’t select kernel in notebook or jupyter lab.
  • Install in (base) conda env pip install --user ipykernel and add your virtual environment to Jupyter by typing: python -m ipykernel install --user --name=myCondaEnv

PIP

  1. How to solve ReadTimeoutError: HTTPSConnectionPool(host=’pypi.python.org’, port=443) with pip?
  • stop proxy or active VPN for installation time. In my case I stopped Hamachi LogMeIn client and reconnected to Wi-Fi.

Docker

  1. Run nvidia-based docker mapping it to all available GPUs on the machine docker run -it --rm -v /data:/data --gpus all --shm-size=64g my/docker_name:version1. Where -v is mapping, --rm performs clean up when the task is done.

  2. Connect running container docker exec -it e14e37231d7c /bin/bash. To detach use ctrl+P+Q

Bash

  1. Disk space management. df -h and du -h --max-depth=1
  2. Find and remove find /dir/to/search/ -type f -name "FILE-TO-FIND-Regex" -exec rm -f {} \;, for example find . -type f -name "events.out.tfevents.*" -exec rm -f {} \;