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

本站现有博文336篇,共被浏览943402

本站已经建立2653天!

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