Windows10+Python3.9安装rnanorm时遇subprocess构建wheel错误
问题
操作系统:Windows 10
Python版本:64位Python 3.9
操作场景:在Jupyter Notebook中执行pip install rnanorm安装工具时失败,已尝试安装/更新numpy仍无法解决,错误信息如下:
error: subprocess-exited-with-error Getting requirements to build wheel did not run successfully. exit code: 1
[34 lines of output] # 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. # pysam: htslib configure options: None Traceback (most recent call last): File "C:\Users\cathe\anaconda3\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() File "C:\Users\cathe\anaconda3\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "C:\Users\cathe\anaconda3\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) File "C:\Users\cathe\AppData\Local\Temp\pip-build-env-0f0iqe9_\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) File "C:\Users\cathe\AppData\Local\Temp\pip-build-env-0f0iqe9_\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires self.run_setup() File "C:\Users\cathe\AppData\Local\Temp\pip-build-env-0f0iqe9_\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup super(_BuildMetaLegacyBackend, File "C:\Users\cathe\AppData\Local\Temp\pip-build-env-0f0iqe9_\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup exec(code, locals()) File "<string>", line 383, in <module> File "<string>", line 79, in run_make_print_config File "C:\Users\cathe\anaconda3\lib\subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Users\cathe\anaconda3\lib\subprocess.py", line 489, in run with Popen(*popenargs, **kwargs) as process: File "C:\Users\cathe\anaconda3\lib\subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\cathe\anaconda3\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] 系统找不到指定的文件。 [end of output] 注意:此错误源自子进程,大概率与pip无关。 error: subprocess-exited-with-error Getting requirements to build wheel did not run successfully. exit code: 1 See above for output.
解决方法
错误原因分析
核心问题是rnanorm依赖的pysam包在Windows环境下编译时,调用了类Unix系统的.命令(用于加载环境变量的source命令),而Windows CMD/PowerShell不支持该语法;同时pysam编译依赖htslib,Windows下手动编译依赖库步骤繁琐,导致构建wheel失败。
具体解决步骤
优先安装预编译的pysam包
用conda安装bioconda频道提供的预编译版本(无需本地编译):conda install -c bioconda pysam确保在Jupyter Notebook中切换到对应的conda环境执行该命令。
安装rnanorm
安装好pysam后,再执行:pip install rnanorm备选方案:直接用conda安装rnanorm
如果conda-forge频道提供了rnanorm的预编译包,也可以直接执行:conda install -c conda-forge rnanorm这种方式会自动处理所有依赖,避免编译问题。
无conda环境的补充方案
可以下载对应Python版本和系统架构的pysam whl文件,手动用pip install 文件名.whl安装,再执行pip install rnanorm。
内容的提问来源于stack exchange,提问作者Eventual V
相关产品推荐
相关产品推荐

