python - 为什么安装pysam python包失败?
问题描述
我是 python 新手并运行命令:
点安装 pysam
结果是:
Collecting pysam
Using cached https://files.pythonhosted.org/packages/25/7e/098753acbdac54ace0c6dc1f8a74b54c8028ab73fb027f6a4215487d1fea/pysam-0.15.4.tar.gz
ERROR: Command errored out with exit status 1:
command: 'c:\path\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\path\\Local\\Temp\\pip-install-qzuue1yz\\pysam\\setup.py'"'"'; __file__='"'"'C:\\path\\Temp\\pip-install-qzuue1yz\\pysam\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
Complete output (23 lines):
# pysam: cython is available - using cythonize if necessary
# pysam: htslib mode is shared
# pysam: HTSLIB_CONFIGURE_OPTIONS=None
'.' is not recognized as an internal or external command,
operable program or batch file.
'.' is not recognized as an internal or external command,
operable program or batch file.
File "<string>", line 1, in <module>
File "C:\path\Local\Temp\pip-install-qzuue1yz\pysam\setup.py", line 241, in <module>
htslib_make_options = run_make_print_config()
File "C:\path\\Local\Temp\pip-install-qzuue1yz\pysam\setup.py", line 68, in run_make_print_config
stdout = subprocess.check_output(["make", "-s", "print-config"])
File "c:\path\programs\python\python38\lib\subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "c:\path\programs\python\python38\lib\subprocess.py", line 489, in run
File "c:\path\programs\python\python38\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "c:\path\programs\python\python38\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
# pysam: htslib configure options: None
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
这里有什么问题?
最初我收到关于未安装 cython 的错误,所以我运行了 pip install cython 并且能够毫无问题地运行它。
解决方案
PyPI有许多二进制轮子,但仅适用于 Linux 和 MacOS X。bioconda 的包也仅针对 Linux 和 OS X 编译。
当您尝试在 Windows 上安装 pysam 时,pip
下载源代码分发pysam-0.15.4.tar.gz
,解压缩并运行setup.y
pysam通过运行脚本来setup.py
配置库。这是一个 shell 脚本,它不能在没有 Unix 仿真层的 Windows 中运行。因此错误。htslib
htslib/configure
底线:就像许多与遗传学相关的软件(我有一些用 Python 和 Java 编写的软件的经验)pysam
似乎只能在 Unix 上使用,最好是 Linux 或 OS X。
推荐阅读
- c++ - C++ 右值参数
- powershell - 更改重复字符串中 1 个字符的值
- javascript - 用于 UI 的 Phaser 3 动态场景选择
- arrays - 如何在 Solidity 中创建动态内存数组?
- c# - 脚手架控制器在 Ubuntu 20.04 的 asp.net core 5 中不起作用
- javascript - 有没有更有效的方法来获取 Javascript 中对象中的多个最小值?
- mongodb - 带有 dart 包 mongo_dart 的 Atlas mongoDB 云服务导致连接异常
- python - 使用 python 混淆文本文件 - 通过反转单词并在它们之间插入特定数量的随机字符
- android - 访问嵌套片段嵌入为
- ansible - 如何使用 Ansible 在 ESXI 中创建虚拟机?