EADST

Python: Compile .py to .so

1. Set up the environment

pip install cython
yum install python-devel (apt-get install python-devel)
yum install gcc (apt-get install gcc)

2. Create a setup.py file

from distutils.core import setup
from Cython.Build import cythonize

setup(ext_modules = cythonize(["your_file_name.py"]))

3. Run this line, the .so file saved in ./build/lib...

python setup.py build_ext

4. Move the .so file to main folder, then import the class or def.

import your_file_name
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
FP64 签证 NameSilo ResNet-50 GIT Quantize FP8 Anaconda CTC MD5 Web Heatmap Qwen2 Clash RAR NLTK LeetCode Data XML Interview git-lfs mmap ms-swift Pytorch Tiktoken 图形思考法 Algorithm Hotel API Plate 多进程 SVR CC Random Mixtral 公式 LoRA LLAMA tqdm TTS COCO Land PyCharm 图标 FP32 C++ Website UI Shortcut Card Hungarian uWSGI 论文速读 Vmess XGBoost LaTeX IndexTTS2 Safetensors git Food Use SQL WebCrawler Ptyhon 云服务器 icon Vim v2ray RGB 版权 JSON Attention 腾讯云 RL InvalidArgumentError Permission Python Bipartite 算法题 logger VPN Cloudreve 多线程 Datetime PIP FP16 NLP UNIX Distillation v0.dev 递归学习法 Ubuntu Tensor 第一性原理 论文 Windows Paper Bitcoin Firewall 飞书 DeepStream FlashAttention Qwen2.5 Video 强化学习 Linux Password TSV TensorFlow Google Color Markdown 音频 净利润 PyTorch Freesound ChatGPT SQLite transformers CAM Proxy Quantization Docker AI LLM Disk 阿里云 HaggingFace BTC PDF Qwen YOLO Animate GGML ONNX CSV Baidu Pillow 关于博主 llama.cpp Pandas CUDA 继承 Translation Numpy 顶会 tar Github Bin WAN Conda SAM Paddle Git 报税 OpenCV Domain Logo Math torchinfo Django Diagram ModelScope Input Image2Text Claude BeautifulSoup BF16 CV GPT4 GoogLeNet Jetson OpenAI uwsgi Breakpoint Streamlit Augmentation 证件照 Base64 HuggingFace 搞笑 Pickle Magnet Michelin VSCode Bert Tracking diffusers Review EXCEL SPIE Excel OCR 财报 Sklearn 域名 scipy FastAPI Template Transformers PDB Zip CLAP Rebuttal News Miniforge Gemma GPTQ Jupyter QWEN CEIR TensorRT DeepSeek hf Crawler Statistics Dataset Nginx Hilton Knowledge Plotly Agent Llama VGG-16 printf Search
站点统计

本站现有博文332篇,共被浏览877967

本站已经建立2585天!

热门文章
文章归档
回到顶部