Conda安装 - Python3,Tensorflow,skdata - 一个环境

时间:2016-10-25 08:58:54

标签: python-3.x installation tensorflow conda

我在OS X Yosemite 10.10.5上为机器学习项目设置环境时遇到了很多麻烦。

目标: 使用skData库获取数据集,使用python 3编程并使用Tensorflow库。最终创造一个拥有这三者的环境。 (我一直在使用conda,因为我安装了Anaconda,这是推荐的方法)

问题: 看来为了用Tensorflow创建一个环境,我不得不使用Conda,但我只能使用pip获取skData。 当我尝试conda install skdata时,终端说

Error:  Package missing in current osx-64 channels:

pip是张量流中的包,所以我尝试使用

pip install SKdata

将SKdata包导入我的python 3 tensorflow环境,但遇到了错误之墙

Collecting skdata
  Using cached skdata-0.0.4.tar.gz
    Complete output from command python setup.py egg_info:
    RefactoringTool: Skipping optional fixer: buffer
    RefactoringTool: Skipping optional fixer: idioms
    RefactoringTool: Skipping optional fixer: set_literal
    RefactoringTool: Skipping optional fixer: ws_comma
    RefactoringTool: Can't open /private/var/folders/nm/xbyhr1490q1bbfpyw41nfgg00000gp/T/pip-build-jyouqltk/skdata/build/py3k: [Errno 2] No such file or directory: '/private/var/folders/nm/xbyhr1490q1bbfpyw41nfgg00000gp/T/pip-build-jyouqltk/skdata/build/py3k'
    RefactoringTool: No files need to be modified.
    RefactoringTool: There was 1 error:
    RefactoringTool: Can't open /private/var/folders/nm/xbyhr1490q1bbfpyw41nfgg00000gp/T/pip-build-jyouqltk/skdata/build/py3k: [Errno 2] No such file or directory: '/private/var/folders/nm/xbyhr1490q1bbfpyw41nfgg00000gp/T/pip-build-jyouqltk/skdata/build/py3k'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/nm/xbyhr1490q1bbfpyw41nfgg00000gp/T/pip-build-jyouqltk/skdata/setup.py", line 64, in <module>
        raise Exception('2to3 failed, exiting ...')
    Exception: 2to3 failed, exiting ...
    Copying source tree into build/py3k for 2to3 transformation...
    Converting to Python3 via 2to3...

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/nm/xbyhr1490q1bbfpyw41nfgg00000gp/T/pip-build-jyouqltk/skdata/

注意:尝试pip install skdata --user

时出现同样的错误

我的环境是在我的anaconda文件夹中设置的

enter image description here

1 个答案:

答案 0 :(得分:0)

看起来pip中提供的skdata版本只能用于python 2.我能够在anaconda python2.7环境中安装它而没有任何问题,但是遇到了与你相同的错误试图在python 3环境中安装它。

我能够从可用的源代码here安装它。

要求安装包SciPyNumPySciKit-Learn。设置将需要root权限才能将skdata添加到您的easy-install路径。我不确定这是否适用于macOS / OSX,但是在Linux上的命令

sudo env "PATH=$PATH" python setup.py install

将在使用您的用户路径时以root权限运行安装,以便将其安装在正确的位置。运行命令时,请确保要安装skdata非活动的anaconda环境。