Skip to content

Commit f55ad3f

Browse files
committed
Fix issue pypa#93 - Tcl doesn't work inside a virtualenv on Windows
1 parent f0a26ae commit f55ad3f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

virtualenv.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,16 @@ def copy_required_modules(dst_prefix, symlink):
10621062
if os.path.exists(pyfile):
10631063
copyfile(pyfile, dst_filename[:-1], symlink)
10641064

1065+
def copy_tcltk(src, dest, symlink):
1066+
""" copy tcl/tk libraries on Windows (issue #93) """
1067+
if majver == 2:
1068+
libver = '8.5'
1069+
else:
1070+
libver = '8.6'
1071+
for name in ['tcl', 'tk']:
1072+
srcdir = src + '/tcl/' + name + libver
1073+
dstdir = dest + '/tcl/' + name + libver
1074+
copyfileordir(srcdir, dstdir, symlink)
10651075

10661076
def subst_path(prefix_path, prefix, home_dir):
10671077
prefix_path = os.path.normpath(prefix_path)
@@ -1118,6 +1128,9 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy
11181128
copy_required_modules(home_dir, symlink)
11191129
finally:
11201130
logger.indent -= 2
1131+
# ...copy tcl/tk
1132+
if is_win:
1133+
copy_tcltk(prefix, home_dir, symlink)
11211134
mkdir(join(lib_dir, 'site-packages'))
11221135
import site
11231136
site_filename = site.__file__

0 commit comments

Comments
 (0)