How can I install a .egg Python package on Windows (attempt using easy_install not working)

别来无恙 提交于 2019-11-29 11:19:50

问题


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:\Python27\Lib\site-packages directory):

    Python easy_install -Z C:\Users\Prosserc\Downloads\QSTK-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).


回答1:


You should add -m before easy_install
for example:

python -m easy_install C:\Users\Prosserc\Downloads\QSTK-0.2.6-py2.7.egg



回答2:


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



回答3:


How about if you unpack the .egg (it's just a .zip in disguise), then cd into it and run python setup.py install? Will that run fine and will you then be able to import your module?

I'm saying this because if the .egg file does get put under site-packages as appropriate but you're still not able to import, this might be a problem in the code itself.




回答4:


I found pip install qstk works perfectly for 64x 2.7 python at win 7



来源:https://stackoverflow.com/questions/18558733/how-can-i-install-a-egg-python-package-on-windows-attempt-using-easy-install-n

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!