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

本站现有博文337篇,共被浏览961391次

本站已经建立2673天!

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