Message12214

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 <1545169801.23.0.788709270274.issue2721@psf.upfronthosting.co.za>
In-reply-to
Content
@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
C:\JYTHON\2.7.1\LIB\SITE-PACKAGES
├─pip
│  ├─commands
│  ├─compat
│  ├─models
│  ├─operations
│  ├─req
│  ├─utils
│  ├─vcs
│  └─_vendor
│      ├─cachecontrol
:      :
│      └─webencodings
├─pip-9.0.1.dist-info
├─pkg_resources
│  ├─extern
│  └─_vendor
│      └─packaging
├─setuptools
│  ├─command
│  └─extern
├─setuptools-28.8.0.dist-info
├─virtualenv-15.2.0.dist-info
└─virtualenv_support

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.)
History
Date User Action Args
2018-12-18 21:50:01jeff.allensetmessageid: <1545169801.23.0.788709270274.issue2721@psf.upfronthosting.co.za>
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