简体   繁体   English

Conda Skeleton为不同的Python版本安装相同的包

[英]Conda Skeleton Installing Same Package For Different Python Versions

I want to install sklearn-pandas for data science on my conda environments so I switch to my Python2 Conda environment and use skeleton to build it in: 我想在我的conda环境中为数据科学安装sklearn-pandas所以我切换到我的Python2 Conda环境并使用骨架来构建它:

conda skeleton pypi sklearn-pandas
conda-build sklearn-pandas
conda install --use-local sklearn-pandas

The problem is, this builds in a bunch of python 3 dependencies, and at the end of it all when I run python --version I get 问题是,这构建了一堆python 3依赖项,并在最后我运行python --version时得到

Python 3.6.6

This means that it had to upgrade the python version of the environment to accommodate the package it installed. 这意味着它必须升级python版本的环境以适应它安装的软件包。

I think this library should be compatible with Python 2, it even says in its Git repo "build universal wheel compatible with python 2 and python 3". 我认为这个库应该与Python 2兼容,它甚至在它的Git repo中说“构建与python 2和python 3兼容的万向轮”。

What arguments do I need to pass to conda skeleton, build, and install so that it installs and builds it for Python 2 and doesn't do this unwanted upgrade? 我需要将哪些参数传递给conda框架,构建和安装,以便它为Python 2安装和构建它并且不进行这种不必要的升级?

Figured this out - you only need to add one flag to the conda-build step. 想出这个 - 你只需要在conda-build步骤中添加一个标志。 It's: 它的:

conda-build --python 2.7 sklearn-pandas

Although in the conda skeleton stage of the installation it appears to bring in py36 packages, once you do this conda-build step with the flag it replaces them with py27. 虽然在安装的conda骨架阶段它似乎引入了py36包,但是一旦用标志执行这个conda-build步骤,它就会用py27替换它们。

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

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