Message9855

Author jmadden
Recipients csojinb, jmadden
Date 2015-04-14.23:10:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429053004.9.0.0248466048799.issue2329@psf.upfronthosting.co.za>
In-reply-to
Content
I also have run into this. Depending on your platform, it's possible to get past this by switching between the CPython-based launcher and the bash-based launcher (and/or a newer virtualenv release). Unfortunately, if you do, then you run into not being able to install pip and setuptools:

$ mkvirtualenv -p dist/bin/jython.py ./jydist2
Running virtualenv with interpreter /jython/dist/bin/jython.py
Cannot find file /jython/dist/Include (bad symlink)
New jython executable in ./jydist2/bin/jython.py
Installing setuptools, pip...
  Complete output from command /...ydist2/bin/jython.py -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip:
  Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named pip
----------------------------------------
...Installing setuptools, pip...done.
Traceback (most recent call last):
  File "/site-packages/virtualenv.py", line 2352, in <module>
    main()
  File "//virtualenv.py", line 816, in main
    create_environment(home_dir,
  File "//site-packages/virtualenv.py", line 993, in create_environment
    install_wheel(to_install, py_executable, search_dirs)
  File "//site-packages/virtualenv.py", line 955, in install_wheel
    call_subprocess(cmd, show_stdout=False,
  File "//site-packages/virtualenv.py", line 901, in call_subprocess
    raise OSError(
OSError: Command /...ydist2/bin/jython.py -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 1

What virtualenv wants to do is put its own specific .whl files on the PYTHONPATH environment variable. It seems that Jython doesn't support wheels on the PYTHONPATH (but I haven't confirmed that). Even if it did, though, there's an incompatibility with a recent pip that's forcing Jython to bundle its own. So until that incompatibility is fixed and a new virtualenv is released with it, I'm afraid virtualenv isn't going to work (unless we can find some workaround in Jython itself), regardless of PYTHONPATH issues. 

Then again, virtualenv also has a tradition of including implementation-specific code for each platform it runs on. For example, it knows that Jython's directory is called "Lib" and not "lib". So maybe after the final release (or a near-enough final release) the virtualenv and Jython maintainers can work together to solve the issue.

I'm happy to help test and debug, time permitting. Being able to use jython with 'tox' is a semi-blocker for official Jython support in a lot of the Zope projects I help with.
History
Date User Action Args
2015-04-14 23:10:04jmaddensetmessageid: <1429053004.9.0.0248466048799.issue2329@psf.upfronthosting.co.za>
2015-04-14 23:10:04jmaddensetrecipients: + jmadden, csojinb
2015-04-14 23:10:04jmaddenlinkissue2329 messages
2015-04-14 23:10:04jmaddencreate