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/02/26 17:22] – [Create execute file exe to run on windows] 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 137: | Line 144: | ||
</ | </ | ||
Windows: download and install it from http:// | Windows: download and install it from http:// | ||
+ | |||
+ | After install, change the PATH of python to PATH of conda | ||
=== Basic Create virtual enviornment with conda === | === Basic Create virtual enviornment with conda === | ||
* Help options in Creating environment:< | * Help options in Creating environment:< | ||
Line 208: | 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: | ||
+ | </ | ||
- Step2: Go to virtual environment zipline:< | - Step2: Go to virtual environment zipline:< | ||
source activate zipline | source activate zipline | ||
+ | </ | ||
+ | conda.bat activate zipline | ||
</ | </ | ||
- 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 229: | 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 1100: | 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.1582737758.txt.gz · Last modified: 2022/10/29 16:15 (external edit)