pip安装pysam
pysam - a python module for reading, manipulating and writing genomic data sets.
pysam is a lightweight wrapper of the htslib C-API and provides facilities to read and write SAM/BAM/VCF/BCF/BED/GFF/GTF/FASTA/FASTQ files as well as access to the command line functionality of the samtools and bcftools packages. The module supports compression and random access through indexing.
This module provides a low-level wrapper around the htslib C-API as using cython and a high-level API for convenient access to the data within standard genomic file formats.
See:
pip install pysam
pip install pysam==0.9.1
pip install https://github.com/pysam-developers/pysam/archive/master.zip
conda install -c bioconda pysam
REF
https://pypi.org/project/pysam/
https://github.com/pysam-developers/pysam
=====================================================
ModuleNotFoundError: No module named 'pysam'
$ python
Python 3.6.7 | packaged by conda-forge | (default, Feb 28 2019, 09:07:38)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysam
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pysam'
>>>
---------------------
Make sure you install pysam for the right python version. In your case, I suggest:
python2.7 -m pip install pysam
/home/software/Python-3.8.5/python -m pip install pysam
[root@ibiomed aimin]# /home/software/Python-3.8.5/python -m pip install pysam
Collecting pysam
Downloading pysam-0.16.0.1-cp38-cp38-manylinux1_x86_64.whl (10.2 MB)
|████████████████████████████████| 10.2 MB 10.6 MB/s
Installing collected packages: pysam
Successfully installed pysam-0.16.0.1
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the '/home/software/Python-3.8.5/python -m pip install --upgrade pip' command.
您在 /var/spool/mail/root 中有新邮件
----------------------
>>> import pysam
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/python3/lib/python3.8/site-packages/pysam/__init__.py", line 16, in <module>
import pysam.libcsamfile as libcsamfile
File "pysam/libcsamfile.pyx", line 1, in init pysam.libcsamfile
File "pysam/libcalignedsegment.pyx", line 60, in init pysam.libcalignedsegment
File "/home/software/Python-3.8.5/Lib/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
-----------------------
>>> import pysam
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/python3/lib/python3.8/site-packages/pysam/__init__.py", line 16, in <module>
import pysam.libcsamfile as libcsamfile
File "pysam/libcsamfile.pyx", line 1, in init pysam.libcsamfile
File "pysam/libcalignedsegment.pyx", line 60, in init pysam.libcalignedsegment
File "/usr/local/python3/lib/python3.8/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
vim /etc/profile
export PYTHON_HOME=/usr/local/python3/
export PATH=PATH
source /etc/profile
-----------------------
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
2019-08-28 WINGIDE 激活失败
2019-08-28 python安装 错误 “User installations are disabled via policy on the machine”
2018-08-28 各种在线词典
2011-08-28 如何查看IIS并发连接数
2009-08-28 Creating sub-projects in IIS with Web Application Projects
2009-08-28 UpdatePanel and Response.Redirect
2008-08-28 2008秋季-计算机软件基础- vc6 wintc 编译器