How to run Tensorboard from python scipt in virtualenv?

Using Tensorboard 2 API (2019): from tensorboard import program tracking_address = log_path # the path of your log file. if __name__ == “__main__”: tb = program.TensorBoard() tb.configure(argv=[None, ‘–logdir’, tracking_address]) url = tb.launch() print(f”Tensorflow listening on {url}”) Note: tb.launch() create a daemon thread that will die automatically when your process is finished

How to create conda env with both name and path specified

create a folder wherever you want to keep you environment files, inside the folder run: conda create –prefix=yourenvname When you wish to use this env, move to the folder in which you ran the previous command and do: source activate yourenvname Or You can run: conda create –prefix=path/yourenvname This will create environment named “yourenvname” in … Read more

Installing pygraphviz on Windows 10 64-bit, Python 3.6

Updated the repo: [GitHub]: CristiFati/Prebuilt-Binaries – (master) Prebuilt-Binaries/PyGraphviz/v1.5: Using official Graphviz 2.42.2 sources .whls (win_amd64, win32) for currently supported Python versions Newer versions might be added (check one level up) For Python 2.7, they are already built: [UCI.LFD]: Unofficial Windows Binaries for Python Extension Packages – PyGraphviz, an interface to the Graphviz graph layout and … Read more

Using Jupyter behind a proxy

Way easier: Just add the following to your notebook: In [1]: import os os.environ[‘http_proxy’] = “http://user:passwd@host:port” os.environ[‘https_proxy’] = “https://user:passwd@host:port” after that, requests will work OK=200, e.g. In [2]: import requests requests.get(“https://google.com”) Out[2]: <Response [200]>

Activating conda environment with its full path

Update for conda 4.4 and up: You need to specify the conda environment path to activate. The new conda activate command should not need the full path to an “activate script” any longer, since the command is now “built-in” to conda. So something like: conda activate (fullpath)/env-name-here should work. The command you have specified activates … Read more

How to upgrade scikit-learn package in anaconda

Anaconda comes with the conda package manager which is designed to handle these kinds of upgrades. Start by updating conda itself to get the most recent package lists: conda update conda And then install the version of scikit-learn you want conda install scikit-learn=0.17 All necessary dependencies will be upgraded as well. If you have trouble … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)