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

本站现有博文327篇,共被浏览826468

本站已经建立2533天!

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