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

本站现有博文339篇,共被浏览991698次

本站已经建立2703天!

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