如何在 Windows 上安装 .egg Python 包(尝试使用 easy_install 不起作用)

2022-01-13 00:00:00 python python-2.7 packages qstk

问题描述

我正在尝试为我正在做的一门课程安装一个名为 QSTK 的软件包.课程指向一个32位版本的安装包,但是我安装了64个Python.我在 Python 包索引上找到了一个 .egg 文件.p>

它似乎有一个 32 位的 exe,但只有 .egg 的 64 位.我下载了 QSTK-0.2.6-py2.7.egg 版本,到目前为止一直在尝试安装,但没有成功.

这是我尝试过的:

  1. 使用简易安装(来自 C:Python27Libsite-packages目录):

    Python easy_install -Z C:UsersProssercDownloadsQSTK-0.2.6-py2.7.egg

    这已经在我的我可以打开并在其中查找文件的 site-packages 目录.但是,我试图从 python shell 导入 QSTK 并得到通常的没有名为...的模块"导入错误.

  2. 我找了一个 setup.py 文件,因为我用这些文件来安装以前的包,但找不到.

  3. 我也看过 这个线程,它提供了详细信息安装 .egg 文件而不使用简单安装,但无法计算找出我需要对提供的脚本进行哪些更改是安装我已经拥有的特定软件包.

如果有人可以通过解释我如何正确安装此 .egg 文件或提供其他格式的 python 2.7 64 位 QSTK 模块的链接来提供帮助,我们将不胜感激.

我已经成功安装了 QSTK 所依赖的软件包(numpy、scipy、matplotlib、pandas、python-dateutil 和 scikit-learn).

解决方案

我终于找到了另一个下载这个包的地方:https://pypi.python.org/pypi/QSTK/0.2.6 有一个 QSTK-0.2.6.tar.gz 选项可以从源代码.

解压这个文件(然后再次下载到 .tar),我可以找到 setup.py 文件并通过转到包含安装文件的目录并运行来安装:

python setup.py install

I am trying to install a package named QSTK for a course that I am doing. The course points to an installation package for the 32 bit version, but I have 64 Python installed. I have found a .egg file listed on the Python packages index.

It seems to have an exe for 32 bit, but just the .egg for 64 bit. I downloaded the QSTK-0.2.6-py2.7.egg version and have been trying to install this unsucessfully so far.

Here is what I have tried:

  1. Using easy install (from the C:Python27Libsite-packages directory):

    Python easy_install -Z C:UsersProssercDownloadsQSTK-0.2.6-py2.7.egg
    

    this has created a QSTK-0.2.6-py2.7.egg directory in my site-packages directory which I can open and find files in. However, I have tried to import QSTK from the python shell and get the usual "No module named..." import error.

  2. I looked for a setup.py file as I have used these to install packages before, but could not find one.

  3. I have also looked at this thread which gives details of installing a .egg file without using easy install, but cannot figure out what changes I would need to make to the script provided as this is to install a specific package that I already have.

If anyone can help by explaining either how I can install this .egg file correctly or by providing a link to the QSTK modules for python 2.7 64 bit in another format this would be greatly appreciated.

I have managed to install the packages that QSTK is dependant on okay (numpy, scipy, matplotlib, pandas, python-dateutil and scikit-learn).

解决方案

I have finally found another place to download this from with a package that works: https://pypi.python.org/pypi/QSTK/0.2.6 has a QSTK-0.2.6.tar.gz option to build it from the source code.

Unzipping this (then again once down to the .tar), I could find the setup.py file and install by going to the directory with the setup file and running:

python setup.py install

相关文章