4

I have installed Jython 2.5 on Windows, then setuptools and finally virtualenv (1.8.4) using easy_install. Now I am trying to create a new virtual environment using the following command line :

jython \Lib\site-packages\virtualenv-1.8.4-py2.5.egg\virtualenv.py jython_env

But the creation of the new virtual environment fails with the following error:

os.symlink(py_executable_base, full_pth)

AttributeError: 'module' object has no attribute 'symlink'

I guess this is because Windows does not handle symlinks but does anyone already meet this issue, is there any workaround ?

Thanks

dry
  • 831
  • 2
  • 8
  • 21

1 Answers1

0

A little bit late, but for the benefit of others who may read this page...

I recently encountered the same issue with jython2.7.0 and managed to get around this by hacking jython's Lib/os.py (mine was under C:\jython2.7.0) to add at the bottom:

def symlink(target, file):
    ''' Just copy files in Windows, 
        maybe you could use mklink system calls instead '''
    from shutil import copy
    copy(file, target)

Don't forget to remove the compiled bytecode version of the os module otherwise the changes won't be loaded.

Then try running virtualenv -p /path/to/jython.exe jython-env-name.

Note that you should either have python2*.dll from your jython bin/ directory in your system PATH , have the dll registered or else copy the dll into your new virtualenv's bin directory.

Liam Deacon
  • 904
  • 1
  • 9
  • 25
  • I've encountered the same issue and used this workaround, but had to switch `target` and `file` – styps Jun 30 '17 at 19:10