Author jeff.allen
Recipients jeff.allen, navneethnarendra, stefan.richthofer
Date 2018-12-18.21:50:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
@Stefan: somewhat similar, I agree, but have become a close acquaintance :)

@Navneeth: this is not quite the right question:

> Then how can I use pip to install above Jython*.jar to site-packages.

Jython is an implementation of Python in Java, entirely separate (as far as the user is concerned) from CPython, which is what most people mean by "Python". Installing Jython gives you a lay-down of directories much like installing CPython, so it has a Lib/site-packages of its own. You should find pip already installed (in bin and in site-packages). It's a slightly tweaked pip, so don't let it update itself.

Here's mine (on Windows):

PS Jeff> ls C:\Jython\2.7.1\bin
-a----       07/05/2018     16:29          98161 easy_install-2.7.exe
-a----       07/05/2018     16:29          98161 easy_install.exe
-a----       30/06/2017     19:03         800491 jython.exe
-a----       30/06/2017     19:03            282 jython_regrtest.bat
-a----       07/05/2018     16:29          98133 pip.exe
-a----       07/05/2018     16:29          98133 pip2.7.exe
-a----       07/05/2018     16:29          98133 pip2.exe
-a----       30/06/2017     19:03        3407872 python27.dll
-a----       07/05/2018     16:43          98140 virtualenv.exe

PS Jeff> tree C:\Jython\2.7.1\Lib\site-packages
│  ├─commands
│  ├─compat
│  ├─models
│  ├─operations
│  ├─req
│  ├─utils
│  ├─vcs
│  └─_vendor
│      ├─cachecontrol
:      :
│      └─webencodings
│  ├─extern
│  └─_vendor
│      └─packaging
│  ├─command
│  └─extern

You can see I've installed virtualenv (with "pip install virtualenv").

I mentioned site-packages because I could see in your Java that you were adding CPython's  to your sys.path. I deduce this is because you already pip-installed some packages for CPython and you want to use them from Jython. But you can't do that: you have to install them again into your copy of Jython. And they have to include no compiled C (sorry).

For that to go smoothly, you need the Jython bin directory on your path ahead of any competing tools of the same name. A check is:

PS Jeff> pip -V
pip 9.0.1 from C:\Jython\2.7.1\Lib\site-packages (python 2.7)

You can also launch pip as a module:
PS Jeff> jython -m pip list
pip (9.0.1)
setuptools (28.8.0)
virtualenv (15.2.0)
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
PS Jeff> 

Remember don't upgrade! (It breaks.)
Date User Action Args
2018-12-18 21:50:01jeff.allensetmessageid: <>
2018-12-18 21:50:01jeff.allensetrecipients: + jeff.allen, stefan.richthofer, navneethnarendra
2018-12-18 21:50:01jeff.allenlinkissue2721 messages
2018-12-18 21:50:00jeff.allencreate