Jython easy_install error

2019-03-06 03:04发布

问题:

My purpose to add some python libraries to jython i.e suds package

To do this tried to follow the instruction from http://www.jython.org/jythonbook/en/1.0/appendixA.html#setuptools

and also checked;

How can I install various Python libraries in Jython?

Installed Jython 2.5.2 and added JYTHON_HOME=C:\jyhon252 to environment variables and %JYTHON_HOME%\bin to path jython is working fine.

As second step tried to install easy_install on top of Jython 2.5.2

got ez_setup.py from;

http://peak.telecommunity.com/dist/ez_setup.py

Tried to install ez_setup.py and got following error that I couldnt find any clue how to solve it. same thing happening with Jython 2.5.3 also.

C:\tmp\ez_setup>jython ez_setup.py

Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg

Processing setuptools-0.6c11-py2.5.egg

Removing c:\jython252\lib\site-packages\setuptools-0.6c11-py2.5.egg

Copying setuptools-0.6c11-py2.5.egg to c:\jython252\lib\site-packages

error: c:\jython252\lib\site-packages\setuptools-0.6c11-py2.5.egg: Unknown error: 20047

I had Windows 7 64bit OS and 32 Bit jre 1.6.0_38 available on my device.

Does anyone have any idea how I can solve this? May I missing some thing ?

Thanks in advance..

回答1:

It was because of windows 7, just use another OS.



回答2:

  • Remove older versions of java and install jdk7
  • Install JYTHON from jar: java -jar jython-installer-2.7-b2.jar
  • Set up environment variables:
    • Add to existing PATH: C:\jython2.7b2;C:\Program Files (x86)\Java\jdk1.7.0_67\bin
    • Create PYTHON and add: C:\jython2.7b2\Lib\site-packages\;
  • Install easy_install
    • Download ez_setup.py
    • Open file and copy paste intall url into browser to download the setuptools-5.7.zip file.
    • Move the zip into the same folder as ez_setup.py.
    • Then run it: jython setup.py install
    • The easy_install will have moved files to your C:\Python27
    • copy all the files from C:\Python27\Lib\site-packages to C:\jython2.7b2\Lib\site-packages
    • copy all the files from C:\Python27\Scripts to C:\jython2.7b2\bin
    • Delete C:\Python27
  • Finally, you need to edit all the scripts so that they don't use Python.exe.
    • Change it to: #!C:\jython2.7b2\jython.bat