Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtualenv doesn't work if TCL is not installed #945

Closed
davidhyman opened this issue Aug 1, 2016 · 5 comments
Closed

virtualenv doesn't work if TCL is not installed #945

davidhyman opened this issue Aug 1, 2016 · 5 comments

Comments

@davidhyman
Copy link

If (for any reason) the user did not elect to install TCL / TK during installation, we get the following error:

  File "c:\python35-32\lib\site-packages\virtualenv.py", line 329, in copyfileordir
    shutil.copy2(src, dest)
  File "c:\python35-32\lib\shutil.py", line 251, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "c:\python35-32\lib\shutil.py", line 114, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'c:\\python35-32/tcl/tcl8.6'

The relevant code is that added to fix #93
#911

I propose the following patch (at ln1076) along the same lines as the code used elsewhere for the dll files (ln1277):

    for name in ['tcl', 'tk']:
        srcdir = src + '/tcl/' + name + libver
        dstdir = dest + '/tcl/' + name + libver
        if os.path.exists(srcdir):
            copyfileordir(srcdir, dstdir, symlink)
        else:
            logger.notify('omitted %s %s because it was not in the source Python distribution', name, libver)

This is a clear message and is forward-compatible should the user later elect to install tkinter and re-create the virtual environment.

@davidhyman
Copy link
Author

Also at a guess this should originally have been written using os.path, rather than string concat?

@jayvdb
Copy link

jayvdb commented Aug 2, 2016

Yes re using os.path , but / usually works on Windows as it is the os.altsep on Windows.

@Ivoz
Copy link

Ivoz commented Aug 5, 2016

Hi there, 6431406 should have solved this issue, and is now in 15.0.3

@Ivoz Ivoz closed this as completed Aug 5, 2016
@c0d3h4x0r
Copy link

Hi there, 6431406 should have solved this issue, and is now in 15.0.3

That did not fix it on Mac.

@gaborbernat gaborbernat reopened this Jan 31, 2020
@gaborbernat
Copy link
Contributor

Can you test with 20.0.0b2? I believe that should have fixed this.

@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants