如何在Windows 10上安装cython Anaconda 64位? [英] How to install cython an Anaconda 64 bits with Windows 10?

查看:96
本文介绍了如何在Windows 10上安装cython Anaconda 64位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部在标题中,有人可以逐步安装cython并在Windows 10的Anaconda 64位上运行它吗?我搜索了几个小时,并且有很多教程...对于我在Windows 10上无法获得或无法完成的事情.我尝试遵循所有这些方法,但现在却徒劳无功: https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_Cython_On_Anaconda_On_Windows?lang = zh_CN

It's all in the title, does someone have a step by step method to install cython and run it on Anaconda 64 bits on Windows 10? I search for hours and there are a lot of tutorials... For things that I wasn't able to get or do on windows 10. I try to follow all those methods and more but in vain for now: https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_Cython_On_Anaconda_On_Windows?lang=en

https://github.com/cython/cython/wiki/CythonExtensionsOnWindows

Conda安装已完成,但问题是将编译器链接到python,使用Windows SDK的所有方法(尤其是SDK命令提示符)已过时,此提示符在Visual Studio 2015中不存在,并且setenv函数不存在已经存在,或者无法执行'setenv \ x64 \ release',并且如果没有此步骤,代码将无法正常工作.

Conda install is done but the problem is to link the compiler to python, all the method using windows SDK and espescially the SDK command prompt are outdated, this prompt doesn't exist on Visual studio 2015 and the setenv function doesn't exist anymore either so impossible to execute 'setenv \x64 \release' and without this step the code doesn't work.

使用MinGW的另一种方法返回错误:

The other methode with MinGW return an error:

C:\MinGW\bin\gcc.exe -shared -s build\temp.win-amd64-3.6\Release\hello.o build\temp.win-amd64-3.6\Release\hello.cp36-win_amd64.def -LC:\Users\Utilisateur\Anaconda3\libs -LC:\Users\Utilisateur\Anaconda3\PCbuild\amd64 -lpython36 -lmsvcr140 -o C:\Users\Utilisateur\Documents\hello.cp36-win_amd64.pyd
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lmsvcr140
collect2.exe: erreur : ld a retourné 1 code d'état d'exécution
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1

所以我不知道下一步该怎么做.

so I don't know what to do next.

请帮助.

一个绝望的学生

推荐答案

好吧,我在Windows 10上使用蟒蛇3.6.5和MSC v.1900 64位的Anaconda解决了该问题(通过运行给出的信息:

Ok I solved the problem on Windows 10 with Anaconda using python 3.6.5 and MSC v.1900 64 bit (informations given by running :

import sys
sys.version

所以这是方法:

1:通过在Anaconda提示符

1: install cython by running conda install -c anaconda cython in Anaconda prompt

2:进入 C:\ Users \ Utilisateur \ Anaconda3 \ Lib \ distutils 或在您的distutils库所在的任何地方创建distutils.cfg文件(使用记事本)并放入

2: go in C:\Users\Utilisateur\Anaconda3\Lib\distutils or wherever your distutils library is the create a distutils.cfg file (by using the notepad) and put

[build]           
compiler=mingw32 

其中

3:通过获取最新版本的Mingw-w64(不仅仅是Mingw仅支持32位)https://sourceforge.net/projects/mingw-w64/files/并安装

4:将 C:\ Program Files(x86)\ mingw-w64 \ i686-8.1.0-posix-dwarf-rt_v6-rev0 \ mingw32 \ bin 添加到您的路径中,这是一个链接有关如何在Windows 10上执行此操作的说明:

4: add C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin to your Path here is a link on how to do that on windows 10: https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/

5:通过运行 conda install -c anaconda libpython conda install -c msys2 m2w64-toolchain 在您的Anaconda环境中安装libpython和m2w64-toolchain它来自这些网页 https://python-at-risoe.pages.windenergy.dtu.dk/compiling-on-windows/common_errors.html 并应纠正相应的错误

5: install libpython and m2w64-toolchain in your anaconda envirement by running conda install -c anaconda libpython and conda install -c msys2 m2w64-toolchain It come from these webpage https://python-at-risoe.pages.windenergy.dtu.dk/compiling-on-windows/common_errors.html and should correct the corresponding errors

6:尝试在此页面上进行第一次或第二次测试 http://docs.cython.org/en/latest/src/quickstart/build.html 都在第5步之后为我工作

6: try the first or second test on this page http://docs.cython.org/en/latest/src/quickstart/build.html both were working for me after step 5

希望这会有所帮助!

这篇关于如何在Windows 10上安装cython Anaconda 64位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆