如何为 Ironpython27 安装 numpy 和 scipy?旧方法不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29397540/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install numpy and scipy for Ironpython27? Old method doesn't work
提问by MacSanhe
I think this is the most popular way to do it before:
我认为这是以前最流行的方法:
https://pytools.codeplex.com/wikipage?title=NumPy%20and%20SciPy%20for%20.Net
https://pytools.codeplex.com/wikipage?title=NumPy%20and%20SciPy%20for%20.Net
But this link is no longer exist:
但是这个链接已经不存在了:
https://store.enthought.com/repo/.iron/
https://store.enthought.com/repo/.iron/
I recently found a clone for the instruction, and also found a clone of ironpkg-1.0.0.py on github. But http://www.enthought.com/repo/.iron/eggs/index-depend.txtis no longer exists in the internet(I googled it, but failed to find it)
我最近找到了一个克隆的指令,也在github上找到了一个ironpkg-1.0.0.py的克隆。但是http://www.enthought.com/repo/.iron/eggs/index-depend.txt在互联网上已经不存在了(我用谷歌搜索,但没找到)
Getting started with SciPy for .NET
.NET 的 SciPy 入门
1.) IronPython Download and install IronPython 2.7, this will require .NET v4.0.
1.) IronPython 下载并安装 IronPython 2.7,这需要 .NET v4.0。
2.) Modify PATH
2.) 修改路径
Add the install location on the path, this is usually: C:\Program File\IronPython 2.7
在路径上添加安装位置,通常是:C:\Program File\IronPython 2.7
But on 64-bit Windows systems it is: C:\Program File (x86)\IronPython 2.7
但是在 64 位 Windows 系统上它是:C:\Program File (x86)\IronPython 2.7
As a check, open a Windows command prompt and go to a directory (which is not the above) and type:
作为检查,打开 Windows 命令提示符并转到一个目录(不是上面的目录)并键入:
ipy -V PythonContext 2.7.0.40 on .NET 4.0.30319.225
.NET 4.0.30319.225 上的 ipy -V PythonContext 2.7.0.40
3.) ironpkg
3.) 铁包
Bootstrap ironpkg, which is a package install manager for binary (egg based) Python packages. Download ironpkg-1.0.0.py and type:
Bootstrap ironpkg,它是二进制(基于蛋的)Python 包的包安装管理器。下载 ironpkg-1.0.0.py 并输入:
ipy ironpkg-1.0.0.py --install
Now the ironpkg command should be available:ironpkg -h (some useful help text is displayed here)
ipy ironpkg-1.0.0.py --install
现在应该可以使用 ironpkg 命令:Ironpkg -h(此处显示一些有用的帮助文本)
4.) scipy
4.) scipy
Installing scipy is now easy:
安装 scipy 现在很容易:
ironpkg scipy numpy-2.0.0b2-1.egg
Ironpkg scipy numpy-2.0.0b2-1.egg
Question
题
I think I have done as much as I can do. Any body succeed to install numpy and scipy for Ironpython27?
我想我已经做了我能做的。有没有人成功为 Ironpython27 安装 numpy 和 scipy?
采纳答案by Nilster
[COMMENT BY ENTHOUGHT SUPPORT: The link in this answer is not valid. See answer below by Jonathan March on August 17, 2018]
[来自 ENTHOUGHT SUPPORT 的评论:此答案中的链接无效。请参阅以下 Jonathan March 于 2018 年 8 月 17 日的回答]
For those struggling to get numpy/scipy install for ironpythopn, enthought have moved the download link to https://store.enthought.com/repo/.iron/. The link would only allow you in if you are registered.
对于那些努力为 Ironpythopn 安装 numpy/scipy 的人,enthought 已将下载链接移至https://store.enthought.com/repo/.iron/。该链接仅允许您在注册后进入。
Therefore first up you'd have to register yourself for free, then open the above link, then follow the steps below
因此,首先您必须免费注册,然后打开上面的链接,然后按照以下步骤操作
Download the IronPython-2.7.msi and install it.
Download ironpkg-1.0.0.py from the above link.
- Using command line navigate to the directory where you placed ironpkg-1.0.0.py and run
ipy ironpkg-1.0.0.py --install
Check whether the install worked usingironpkg -h
The last step is lightly different to the one suggested by enthoughts. Running
ironpkg scipy
won't work as it looks at the old web address for download. Instead download all the eggs andindex-depend.txt
from the above link. For installation to work, you would have to modify the download location in the config file to point to the local drive instead of website. The config file can be found at user directory eg.C:\Users\Nilster\.ironpkg
. Open it in the textpad and change the location to directory where you downloaded the eggs Eg, mine looks likeIndexedRepos = ['file://C:\Work\Python\Enthought_Eggs',]
Then run the following to install numpy/scipy
ironpkg scipy
Check whether the install worked using
ipy -X:Frames -c "import scipy"
下载 IronPython-2.7.msi 并安装它。
从上面的链接下载 ironpkg-1.0.0.py。
- 使用命令行导航到放置 ironpkg-1.0.0.py 的目录并运行
ipy ironpkg-1.0.0.py --install
检查安装是否使用ironpkg -h
最后一步与 enthoughts 建议的步骤略有不同。运行
ironpkg scipy
将不起作用,因为它会查看旧网址进行下载。而是index-depend.txt
从上面的链接下载所有的鸡蛋。为了安装工作,您必须修改配置文件中的下载位置以指向本地驱动器而不是网站。配置文件可以在用户目录中找到,例如。C:\Users\Nilster\.ironpkg
. 在 textpad 中打开它并将位置更改为下载鸡蛋的目录 例如,我的看起来像IndexedRepos = ['file://C:\Work\Python\Enthought_Eggs',]
然后运行以下命令安装 numpy/scipy
ironpkg scipy
检查安装是否使用
ipy -X:Frames -c "import scipy"
回答by user3782261
Just to confirm @Nilster's second sentence: I just received an email from Enthought support saying the following: [Note: this link is obsolete.]
只是为了确认@Nilster 的第二句话:我刚刚收到一封来自 Enthought 支持的电子邮件,内容如下:[注意:此链接已过时。]
The IronPython repos are still available, but are no longer maintained. To access them, you must be logged in on Enthought.com. The link to these repos is: http://www.enthought.com/repo/.iron/
IronPython 存储库仍然可用,但不再维护。要访问它们,您必须登录 Enthought.com。这些存储库的链接是:http: //www.enthought.com/repo/.iron/
After signing up I followed Nilster's instructions and everything worked without a hitch. The only that I'd add is that the .ironpkg config file mentioned in step 4 is a system file according to Windows, so you show system files in Windows folder view options; just showing hidden files won't reveal it
注册后,我按照 Nilster 的指示进行操作,一切顺利。我唯一要补充的是,第 4 步中提到的 .ironpkg 配置文件是 Windows 的系统文件,因此您可以在 Windows 文件夹视图选项中显示系统文件;只显示隐藏文件不会显示它
回答by nesaboz
So instructions at the Enthough link got me all the way to the step 4 (ironpkg scipy) but then I had issue with urllib2 (I don't know what went wrong, it just says "Can't open URL ...")
所以 Enthough 链接上的说明让我一直到第 4 步(ironpkg scipy),但后来我遇到了 urllib2 的问题(我不知道出了什么问题,它只是说“无法打开 URL ...”)
And while this one is more current post: http://www.grasshopper3d.com/forum/topics/scipy-and-numpyI'm still stuck at: 'NumpyDotNet.NpyCoreApi' threw an exception
虽然这是最新的帖子:http: //www.grasshopper3d.com/forum/topics/scipy-and-numpy我仍然停留在:'NumpyDotNet.NpyCoreApi' 抛出异常
so I'm giving up, this has been a rabbit hole. Issue is clearly that IronPython is super old and should be avoided in my opinion.
所以我放弃了,这是一个兔子洞。问题显然是 IronPython 太旧了,我认为应该避免使用。
回答by Jonathan March
Enthought support here.
思想支持在这里。
The Iron Python numpy and scipy packages can be downloaded here: http://code.enthought.com/.iron/README.txthttp://code.enthought.com/.iron/eggs/index.html
Iron Python numpy 和 scipy 包可以在这里下载:http://code.enthought.com/.iron/README.txt http://code.enthought.com/.iron/eggs/index.html
FYI, Microsoft stopped work on the IronPython project in 2012 in favor of supporting standard CPython. Those archived versions of numpy and scipy were built in 2011 (so contain no newer features or fixes), and are 32-bit-only. We do not plan to update them in any way.
仅供参考,微软在 2012 年停止了 IronPython 项目的工作,转而支持标准 CPython。numpy 和 scipy 的那些存档版本是在 2011 年构建的(因此不包含更新的功能或修复),并且只有 32 位。我们不打算以任何方式更新它们。
FYI, we typically recommend that those who wish to use Python in a .net context consider using the actively developed pythonnet package to interface with the living CPython ecosystem.
仅供参考,我们通常建议那些希望在 .net 上下文中使用 Python 的人考虑使用积极开发的 pythonnet 包来与现有的 CPython 生态系统交互。
回答by Hymanson Bush
Updated Instructions July 2019:
2019 年 7 月更新说明:
I was able to get scipy up and running in IronPython but wasn't able to follow @Nilser's instructions completely. Here are some updated instructions to get it working.
我能够在 IronPython 中启动并运行 scipy,但无法完全遵循 @Nilser 的说明。以下是一些更新说明以使其正常工作。
Like others have said, the repo is now at http://code.enthought.com/.iron/eggs/index.html. Don't bother signing up for an Enthoughts account to access the old link, like some of the above comments suggest.
就像其他人所说的那样,repo 现在位于http://code.enthought.com/.iron/eggs/index.html。不要费心注册 Enthoughts 帐户来访问旧链接,就像上面的一些评论所暗示的那样。
The ironpkg-1.0.0.py file is no longer hosted in Enthought's repo for some reason. I was able to track it down and am hosting it on githubso it's easier to find.
由于某种原因,ironpkg-1.0.0.py 文件不再托管在 Enthought 的存储库中。我能够追踪它并将其托管在 github 上,因此更容易找到。
- Download IronPython-2.7.5.msi from the IronLanguages GitHub pageand install it. I wasn't able to get scipy to work on newer versions of IronPython. I believe the dlls are bound to the 2.7.5 release of IronPython.
- Download ironpkg-1.0.0.1.egg from the Enthought repo at the above link.
- Copy the contents of the ironpkg-1.0.0.pyfrom GitHub and create a new file with the contents named 'ironpkg-1.0.0.py' in the same folder that you downloaded the ironpkg egg.
- Open the cmd prompt as an administrator and navigate to where the ironpkg-1.0.0.py file is. Run
ipy ironpkg-1.0.0.py --install
. Check whether the install worked usingironpkg -h
. - Since Enthoughts changed the location of their repository, it is necessary to change the ironpkg config file to point to the address of the new location. The config file can be found at the user directory e.g.
c:\users\<your user name>\.ironpkg
. Also note that this is a system file, so you have to show system files in order to see it. Open it in a textpad and update the address. Should be:
- 从IronLanguages GitHub 页面下载 IronPython-2.7.5.msi并安装它。我无法让 scipy 在较新版本的 IronPython 上工作。我相信 dll 绑定到 IronPython 的 2.7.5 版本。
- 从上面链接的 Enthought 存储库下载 ironpkg-1.0.0.1.egg。
- 从 GitHub复制ironpkg-1.0.0.py的内容,并在下载 ironpkg egg 的同一文件夹中创建一个名为“ironpkg-1.0.0.py”的新文件。
- 以管理员身份打开 cmd 提示符并导航到 Ironpkg-1.0.0.py 文件所在的位置。运行
ipy ironpkg-1.0.0.py --install
。检查安装是否使用ironpkg -h
. - 由于 Enthoughts 更改了其存储库的位置,因此有必要更改 Ironpkg 配置文件以指向新位置的地址。配置文件可以在用户目录中找到,例如
c:\users\<your user name>\.ironpkg
. 另请注意,这是一个系统文件,因此您必须显示系统文件才能看到它。在文本板中打开它并更新地址。应该:
IndexedRepos = [
'http://code.enthought.com/.iron/eggs',
]
- Now you can run
ironpkg scipy
to install scipy and its dependencies. - Check whether the install worked by running
ipy -X:Frames -c "import scipy"
- 现在您可以运行
ironpkg scipy
以安装 scipy 及其依赖项。 - 检查安装是否通过运行
ipy -X:Frames -c "import scipy"