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

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

本站已经建立2583天!

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