How do I force easy_install.exe to print output in the current command window?

拟墨画扇 提交于 2019-12-11 07:02:44

问题


I am running Windows 7 64 bit and have installed easy_install. When I run easy_install from the command prompt it opens another window for the output and quickly closes before I am able to examine what has been done.

I am aware of this question but think it may have been closed prematurely as the solution that the closed ticket referred to here does not work on my system.

When I run the cmd window as Administrator and then execute (for example):

$ easy_install pip

I get the same behavior ... another cmd window flashes and then I am returned to the prompt with no output. How then do I force easy_install to output its results in the current window?

UPDATE: (additional information) This same behavior is exhibited when using pip.exe and virtualenv.exe as well. This must have something to do with how these executables are built and how they interact with windows 7 64bit.


回答1:


I discovered that the issue was the version of setuptools that I was using. I had installed python-2.7.1.amd64 and then installed setuptools-0.6c12dev.win-amd64-py2.7.

In the the quest to grab a 64 bit setuptool - I failed to notice the "dev" part of the filename.

It turns out when I uninstalled it and then installed setuptools-0.6c11.win32-py2.7 all output stays in the console. There seems to be some issues with the newer "c12" version.

On a related note - this fixes the same problem with the use of pip and virtualenv as well.




回答2:


Windows 7 has made user privileges a huge hassle. It's intended to protect the average user but gives developers headaches.

Run cmd.exe as Admin (right-click on the .exe and then select "Run as Administrator") and this problem should be solved.

I've also seen this happen if you install a virtualenv and then change the parent directory name. The path seems to be hardcoded in various files when you install the virtualenv, so changing anything upstream gives it fits. You can either grep/wingrep all the files that contain the path and manually update it, or do a Google search and find the "correct" way to fix the problem (I think there is one).




回答3:


First try this:

  • Backup your Scripts\easy_install.exe to somewhere else
  • Go to Lib\site-packages\site-packages\distribute-0.6.13-py2.6.egg\setuptools and copy cli.exe to Scripts\, then rename it to easy_install.exe
  • Run and see the result.

I'm using distribute here, if you are using setuptools and the above steps doesn't work, I suggest you give distribute a try.




回答4:


I had the same issue (new window behavior displayed across a number of libraries) - I believe it was the result of the compilation method used for the setuptools binary.

I had originally used the compiled binaries that were available here:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

I just had to uninstall the setuptools binary and install one available here:

http://pypi.python.org/pypi/setuptools

Presumably you'd also be able to compile your own version should you need a win64 binary.




回答5:


I had such problem with pip and easy_install on Windows 7. You can just use Powershell (could be found in accessories). It works fine.




回答6:


i too faced the same problem once, here is an easy and quick solution

try specifying the commands like so:

c:\python27\python.exe -m easy_install Django==1.6.5v



来源:https://stackoverflow.com/questions/5494080/how-do-i-force-easy-install-exe-to-print-output-in-the-current-command-window

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