User Tools

Site Tools


conda_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
conda_notes [2023/07/10 04:15] – [environment file to install pip package from a local repository] rajuconda_notes [2024/04/07 02:01] – [environment file to install from a specific git branch] raju
Line 2: Line 2:
 ==== tasks ==== ==== tasks ====
   * [[conda environment file to install different packages from different channels]]   * [[conda environment file to install different packages from different channels]]
 +    * tags | conda-forge::foo
  
 ==== Remove an environment ==== ==== Remove an environment ====
Line 37: Line 38:
  
 ==== update conda ==== ==== update conda ====
 +<code>
 +conda update -n base -c defaults conda --repodata-fn=repodata.json
 +</code>
 +
 <code> <code>
 conda update -n <env_name> -c defaults --yes conda conda update -n <env_name> -c defaults --yes conda
Line 220: Line 225:
   * conda config - https://docs.conda.io/projects/conda/en/latest/commands/config.html   * conda config - https://docs.conda.io/projects/conda/en/latest/commands/config.html
   * pinning packages - https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#preventing-packages-from-updating-pinning   * pinning packages - https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#preventing-packages-from-updating-pinning
 +
 +==== which solver am I using? ====
 +Use
 +<code>
 +conda config --show solver
 +</code>
 +or
 +<code>
 +conda config --show-sources
 +</code>
 +
 +
 +Sample output:
 +<code>
 +$ conda config --show solver
 +solver: classic
 +</code>
 +
 +<code>
 +$ conda config --show solver
 +solver: libmamba
 +</code>
 +
 +<code>
 +$conda config --show-sources
 +==> C:\Users\root\.condarc <==
 +solver: libmamba
 +
 +==> cmd_line <==
 +debug: False
 +json: False
 +</code>
 +
 +See also:-
 +  * https://conda.github.io/conda-libmamba-solver/getting-started/ - tells how to switch the default solver from classic to libmamba.
 +
 +==== when was a conda environment created? ====
 +<code>
 +conda env list | grep -v '^#' | perl -lane 'print $F[-1]' | xargs ls -lrt1d
 +</code>
 +
 +For example
 +<code>
 + % conda env list | grep -v '^#' | perl -lane 'print $F[-1]' | xargs ls -lrt1d
 +drwxr-xr-x 10 rajulocal rajulocal 4096 Apr  4  2020 /opt/rajulocal/miniconda3/envs/rutils
 +drwxr-xr-x 23 rajulocal rajulocal 4096 Nov  8  2021 /opt/rajulocal/miniconda3/envs/py39
 +drwxr-xr-x 13 rajulocal rajulocal 4096 Jun  6  2022 /opt/rajulocal/miniconda3/envs/play_ground
 +drwxr-xr-x 27 rajulocal rajulocal 4096 Feb 28  2023 /opt/rajulocal/miniconda3/envs/py310
 +drwxr-xr-x 13 rajulocal rajulocal 4096 May 20  2023 /opt/rajulocal/miniconda3/envs/test_yfinance
 +drwxr-xr-x 18 rajulocal rajulocal 4096 Jun 30 00:45 /opt/rajulocal/miniconda3
 +drwxr-xr-x 27 rajulocal rajulocal 4096 Jul 11 01:07 /opt/rajulocal/miniconda3/envs/py311
 +drwxr-xr-x 24 rajulocal rajulocal 4096 Nov 12 04:44 /opt/rajulocal/miniconda3/envs/market_data_processor
 +</code>
 +
 +Ref: https://stackoverflow.com/questions/69109316/how-can-i-see-the-creation-dates-for-my-conda-environments
  
 ===== activate conda environment ===== ===== activate conda environment =====
Line 323: Line 383:
   * https://manpages.debian.org/bookworm/python3-pip/pip.1.en.html - where I found the <nowiki>--find-links</nowiki> option   * https://manpages.debian.org/bookworm/python3-pip/pip.1.en.html - where I found the <nowiki>--find-links</nowiki> option
  
-tags | <nowiki>--find-links</nowiki>, pip config local packages, how to specify local repo location for pip packages+tags | <nowiki>--find-links</nowiki>, pip config local packages, how to specify local repo location for pip packages, conda install pip package from a "local directory" 
 + 
 +==== specify package version with "git+https" in conda environment file ==== 
 +<code> 
 +name: test_chessli 
 +channels: 
 +  - defaults 
 +dependencies: 
 +  - python=3.11 
 +  - pandas=1.5.3 
 +  - pip 
 +  - pip: 
 +    - chessli 
 +    - git+https://github.com/lervag/apy.git@v0.6.0#egg=apy 
 +</code> 
 + 
 +Ref:- 
 +  * https://stackoverflow.com/questions/47617552/how-can-i-specify-a-custom-git-branch-in-my-pipfile - where I found the answer 
 +  * https://github.com/lervag/apy/tags?after=v0.9.1 - versions of the api package < 0.9.1 
 + 
 +tags | pip "git+https" release, conda "git+https" release, conda git depend on a "specific release"
  
 ===== dummy ===== ===== dummy =====
Line 353: Line 433:
   * https://github.com/conda/conda/releases - conda release history   * https://github.com/conda/conda/releases - conda release history
   * https://calver.org/ - CalVer - Calendar Versioning   * https://calver.org/ - CalVer - Calendar Versioning
 +
 +==== twsapi conda environment file ====
 +  * Build a wheel file from the zip file.
 +    * See for example https://github.com/KamarajuKusumanchi/market_data_processor/blob/master/src/scripts/build_twsapi.sh which builds a wheel file from the TWS python api zip file (https://interactivebrokers.github.io/downloads/twsapi_macunix.1022.01.zip)
 +  * Configure pip to install its wheels from a local wheel directory <code>pip config set global.find-links file:///home/rajulocal/software/dist</code>
 +
 +  * Install the package
 +    * See for example https://github.com/KamarajuKusumanchi/rutils/blob/master/python3/envs/env_test_ibapi.yml
 +
 +tags | conda envrionment install package from zip file, conda install zip package, install zip file
  
conda_notes.txt · Last modified: 2024/04/07 02:02 by raju