简体   繁体   English

无法在命令提示符或 anaconda 提示符下安装 Snakemake

[英]Unable to install Snakemake in either command prompt nor anaconda prompt

I'm trying to install Snakemake.我正在尝试安装 Snakemake。

When I try to use pip, I receive the following error message:当我尝试使用 pip 时,我收到以下错误消息:

ERROR: Complete output from command 'C:\Python\Python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\ANGELA~1\\AppData\\Local\\Temp\\pip-install-1kbp7voq\\datrie\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\ANGELA~1\AppData\Local\Temp\pip-record-_eliva3i\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_clib
building 'libdatrie' library
creating build
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\libdatrie
creating build\temp.win-amd64-3.7\libdatrie\datrie
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ilibdatrie "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\include" /Tclibdatrie\datrie\alpha-map.c /Fobuild\temp.win-amd64-3.7\libdatrie\datrie\alpha-map.obj
alpha-map.c
libdatrie\datrie\alpha-map.c(27): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.21.27702\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command "'C:\Python\Python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\ANGELA~1\\AppData\\Local\\Temp\\pip-install-1kbp7voq\\datrie\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\ANGELA~1\AppData\Local\Temp\pip-record-_eliva3i\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ANGELA~1\AppData\Local\Temp\pip-install-1kbp7voq\datrie\

I've downloaded C++ and python build tools for MS Visual studio 2019. I've also upgraded setup tools.我已经为 MS Visual Studio 2019 下载了 C++ 和 python 构建工具。我还升级了设置工具。

When I try to install using the anaconda prompt, I get this:当我尝试使用 anaconda 提示符进行安装时,我得到以下信息:

PackagesNotFoundError: The following packages are not available from current channels:

 > - snakemake -> pygraphviz

conda install pygraphviz also yields the same message, and I've appended conda-forge to the channels. conda install pygraphviz也会产生相同的消息,并且我已将 conda- conda install pygraphviz附加到通道中。

conda install -c bioconda snakemake

The package is in the bioconda channel.包裹在bioconda频道中。 It's good practice to hit up https://anaconda.org/ and search for any new packages you want to install since the website will actually tell you in which channel the package is.访问https://anaconda.org/并搜索您要安装的任何新软件包是一种很好的做法,因为该网站实际上会告诉您该软件包位于哪个频道。

PyPI PyPI

The pip error has some related questions (eg, Cannot open include file: 'ctype.h': No such file or directory ), but I didn't see any VS2019-specific solutions. pip错误有一些相关的问题(例如,无法打开包含文件:'ctype.h':没有这样的文件或目录),但我没有看到任何 VS2019 特定的解决方案。 And the older solutions seem to have various causes, which sounds like a mess to me.旧的解决方案似乎有各种原因,这对我来说听起来很混乱。

Conda康达

I'd still try the Conda route.我仍然会尝试 Conda 路线。 The issue here is that the default Snakemake build requires pygraphviz and that's not available for win-64 platform through any of your channels.这里的问题是默认的 Snakemake 构建需要pygraphviz而这不能通过您的任何渠道用于win-64平台。

No Graphviz没有Graphviz

The easiest alternative is to opt for the snakemake-minimal package instead, which doesn't have the pygraphviz dependency.最简单的替代方法是选择snakemake-minimal包,它没有pygraphviz依赖项。 The only thing Snakemake uses Graphviz for is to generate DAG plots, which in my experience is practically useless for anything but rather trivial pipelines anyway. Snakemake 使用 Graphviz 的唯一目的是生成 DAG 图,根据我的经验,这实际上对任何东西都没用,但无论如何都很琐碎。 The minimal version also leaves out remote file support (eg, DropBox interfacing) and fancy report generation.最小版本还省去了远程文件支持(例如,DropBox 接口)和花哨的报告生成。 So, if you just need core functionality, then run所以,如果你只需要核心功能,那么运行

conda install snakemake-minimal

(I'm assuming you already have Bioconda + Conda Forge channels.) (我假设您已经拥有 Bioconda + Conda Forge 频道。)

Graphviz图形可视化

If you really want the Graphviz plot or other extras, you could try something like如果你真的想要 Graphviz 情节或其他额外的东西,你可以尝试像

conda activate
conda install graphviz pip
pip install pygraphviz
conda install snakemake

That is, make sure to use the pip in your Conda env , and only use it to install pygraphviz .也就是说,确保在您的 Conda env 中使用pip ,并且仅使用它来安装pygraphviz However, using both PyPI and Conda can lead to an unstable env .但是,同时使用 PyPI 和 Conda会导致 env 不稳定

There are some user channels on Anaconda Cloud that have win-64 builds of pygraphviz , but I do not recommend sourcing from random user channels unless you trust them. Anaconda Cloud 上有一些用户频道具有pygraphviz win-64版本,但我不建议从随机用户频道采购,除非您信任它们。

According to this issue , snakemake cannot currently be installed right away using pip under python3.7.根据这个问题,python3.7下目前无法使用pip立即安装snakemake。 It's dependency datrie cannot be installed automatically.它的依赖datrie无法自动安装。

On the issue discussion, there is a suggested workaround: first installing datrie from git, then snakemake :在问题讨论中,有一个建议的解决方法:首先从 git 安装datrie ,然后是snakemake

pip3 install git+https://github.com/pytries/datrie.git
pip3 install snakemake

See https://github.com/snakemake/snakemake/issues/246https://github.com/snakemake/snakemake/issues/246

This is not a bug with snakemake , but a known issue with datrie .不是snakemake的错误,但有一个已知的问题datrie There is a PR currently open which solves this problem, but until it is merged, the following solutions should work.目前有一个PR解决了这个问题,但在合并之前,以下解决方案应该有效。

A previous issue on bitbucket has dealt with this for python3.7.上一个关于 bitbucket 的问题已经针对 python3.7 处理了这个问题。

Workaround解决方法

Python3.7 Python3.7

pip3 install git+https://github.com/pytries/datrie.git
pip3 install snakemake

Python3.8 Python3.8

pip3 install "git+https://github.com/ashwinvis/datrie.git@python3.8"
pip3 install snakemake

The error shows that the package you are trying to install uses Microsoft VCC compiler错误显示您尝试安装的包使用了 Microsoft VCC 编译器

 No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX86\x64\cl.exe' failed with exit status 2 

Install Microsoft Visual Studio 2019 to solve this issue安装 Microsoft Visual Studio 2019 解决此问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM