Skip to content

vicb1/python-reference

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-reference

package backup with conda

source activate condaEnv
conda env export > environment.yml OR !conda env export --name condaEnv
conda env create --file environment.yml --name environment1

Create new env and install libraries for jupyter-lab. Make sure to restart jupyter-lab after these changes:

conda create -n kaggle13 python=3.7.6 (for Kaggle) OR 3.8.5 for latest
source activate kaggle13
conda install ipykernel
ipython kernel install --user --name=kaggle13

list conda envs

(conda env list | grep '^\w' | cut -d' ' -f1)

package backup with pip

env1/pip freeze > requirements.txt
env1/pip install -r requirements.txt

To be able to see kernel in jupyter-notebook. Make sure to restart jupyter-notebook after these changes:

source activate env1
pip install --user ipykernel
python -m ipykernel install --user --name=env1

Debug in JupyterLab

https://jupyterlab.readthedocs.io/en/stable/user/debugger.html

JupyterLab restart kernel and run all shortcut

{"shortcuts": [
    {
        "command": "runmenu:restart-and-run-all",
        "keys": ["Ctrl Shift Enter"],
        "selector": "[data-jp-code-runner]"
    }
              ]
}

find location of conda environment

where python or which python

Default Anaconda channels

defaults
conda-forge
https://pypi.python.org/
https://repo.continuum.io/
https://pypi.python.org/simple
https://pypi.python.org/pypi

check current python environment information

import platform
print('architecture:', platform.architecture())
print('python_version:', platform.python_version())

import wheel.pep425tags
import pprint
print('-wheel.pep425tags.get_supported:')
pprint.pprint(wheel.pep425tags.get_supported())

install package with setup.py

pip install .

install .whl package

pip install test.whl

install package from Git repository

pip install -e git+https://github.com/hiive/hiivemdptoolbox#egg=hiive.mdptoolbox

Tensorboard startup

tensorboard --logdir logs

Postgres terminate connections

select pg_terminate_backend(pid) from pg_stat_activity where datname='db';

python graph speedup

https://git.skewed.de/count0/graph-tool

limit memory usage tensorflow

tensorflow/tensorflow#25138

install anaconda navigator

https://docs.anaconda.com/anaconda/install/linux/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published