script:python
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| script:python [2020/11/25 13:25] – [Create virtual environment for zipline app and using it] admin | script:python [2025/01/01 04:22] (current) – [Basic Commands] admin | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| </ | </ | ||
| pip 7.1.2 from D: | pip 7.1.2 from D: | ||
| + | </ | ||
| + | ===== Basic Commands ===== | ||
| + |   * Check version python:< | ||
| + | python --version | ||
| + | </ | ||
| + |   * Check package version< | ||
| + | pip show < | ||
| </ | </ | ||
| ===== Convert Python Script to execute file on windows ===== | ===== Convert Python Script to execute file on windows ===== | ||
| Line 210: | Line 217: | ||
| </ | </ | ||
| === Create virtual environment for zipline app and using it === | === Create virtual environment for zipline app and using it === | ||
| - | We will install **zipline** which requirement package **numpy**: | + | We will install **zipline** which requirement package **numpy**  | 
|   - Step1: Create new virtual environment with name **zipline** which contain package **numpy** in conda< |   - Step1: Create new virtual environment with name **zipline** which contain package **numpy** in conda< | ||
| conda create -n zipline numpy | conda create -n zipline numpy | ||
| - | </ | + | </ | 
| D: | D: | ||
| </ | </ | ||
| Line 223: | Line 230: | ||
|   - Step3: Install zipline in environment:< |   - Step3: Install zipline in environment:< | ||
| conda install -c Quantopian zipline | conda install -c Quantopian zipline | ||
| - | </ | + | </ | 
| === Other commands of conda === | === Other commands of conda === | ||
|   * List environments in conda< |   * List environments in conda< | ||
| Line 235: | Line 242: | ||
|   * Remove environment in conda:< |   * Remove environment in conda:< | ||
| conda env remove -n zipline | conda env remove -n zipline | ||
| - | </ | + | </ | 
| - | ==== anaconda  | + |   * Install packages in environment https:// | 
| + | ==== Anaconda  | ||
| install anaconda:< | install anaconda:< | ||
| conda install anaconda | conda install anaconda | ||
| </ | </ | ||
| - | ===== Build python modules from source  | + | ==== Build python modules from source ==== | 
| - Step1: Download source and go to source directory and run<code bat> | - Step1: Download source and go to source directory and run<code bat> | ||
| pip install -r requirements.txt | pip install -r requirements.txt | ||
| Line 1106: | Line 1114: | ||
| else: | else: | ||
|    If there is no exception then execute this block.  |    If there is no exception then execute this block.  | ||
| + | </ | ||
| + | try: | ||
| + | You do your operations here; | ||
| + |     | ||
| + | except: | ||
| + | If there is any exception, then execute this block. | ||
| + |     | ||
| </ | </ | ||
|   * The except clause with multiple exceptions< |   * The except clause with multiple exceptions< | ||
script/python.1606310702.txt.gz · Last modified:  (external edit)
                
                