Installation
This tutorial demonstrates how to install Pysodb on a method which use for pseudo-spatiotemporal analysis.
Using spaceflow as an example, install Pysodb in its installation environment.
Reference tutorials presents can be found at https://github.com/hongleir/SpaceFlow and https://github.com/TencentAILabHealthcare/pysodb.
Installing softwares and tools
1. The first step is to install Visual Studio Code, Conda, Jupyter notebook, and CUDA in advance.
Reference tutorials presents how to install Visual Studio Code, Conda, Jupyter notebook and CUDA, respectively. And they can be found at https://code.visualstudio.com/Docs/setup/setup-overview, https://code.visualstudio.com/docs/python/environments#_activating-an-environment-in-the-terminal, https://code.visualstudio.com/docs/datascience/data-science-tutorial and https://developer.nvidia.com/cuda-downloads.
2. Launch Visual Studio Code and open a terminal window.
Henceforth, various packages or modules will be installed via the command line
Installation SpaceFlow
3. Create a conda environment
[ ]:
conda create -n <environment_name> python=3.8
4. Activate a conda environment
Run the following command on the terminal to activate the conda environment:
[ ]:
conda activate <environment_name>
5. Install torch with CUDA
eg. pip install torch==1.13.0+cu117 -f https://download.pytorch.org/whl/cu117/torch_stable.html
[ ]:
pip install torch==<torch_version>+<cuda_version> -f https://download.pytorch.org/whl/<cuda_version>/torch_stable.html
6. Install torch_scatter, torch_sparse and torch_cluster
Install a Torch_scatter, Torch_sparse and torch_cluster according to the version of pytorch and CUDA, system. Select the package and copy a run command to run on your terminal. https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html
eg. pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-1.13.0+cu117.html
7. Install SpaceFlow package
[ ]:
pip install SpaceFlow
8. Install palettable package
[ ]:
pip install palettable
Installation Pysodb
Keep the conda environment active
9. Select the installation path and open it
[ ]:
cd <path>
10. Clone Pysodb code
[ ]:
git clone https://github.com/TencentAILabHealthcare/pysodb.git
If cloning the code fails through git, please download it at https://github.com/TencentAILabHealthcare/pysodb, upload it to the folder created above, and extract it.
11. Open the Pysodb directory
[ ]:
cd pysodb
12. Install a Pysodb package from source code
[ ]:
python setup.py install
If “error: urllib3 2.0.0a3 is installed but urllib3<1.27,>=1.21.1 is required by {‘requests’}” appears, users can execute the following commands,respectively.
[ ]:
pip install 'urllib3>=1.21.1,<1.27'
python setup.py install
[1]:
print('finish!')
finish!