在Windows中使用VirtualEnv和Python3.5,FileNotFoundError

时间:2016-06-08 22:26:12

标签: python-3.x virtualenv

我正在尝试使用virtualenv,但我一直遇到以下错误: 我用pip8.1.2安装了virtualenv

C:\Users\Jeff\Desktop\first_django_app>virtualenv venv
Using base prefix 'c:\\users\\jeff\\appdata\\local\\programs\\python\\python35-32'
Traceback (most recent call last):
  File "c:\users\jeff\appdata\local\programs\python\python35-32\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\jeff\appdata\local\programs\python\python35-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Jeff\AppData\Local\Programs\Python\Python35-32\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
  File "c:\users\jeff\appdata\local\programs\python\python35-32\lib\site-packages\virtualenv.py", line 711, in main
    symlink=options.symlink)
  File "c:\users\jeff\appdata\local\programs\python\python35-32\lib\site-packages\virtualenv.py", line 924, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "c:\users\jeff\appdata\local\programs\python\python35-32\lib\site-packages\virtualenv.py", line 1136, in install_python
    copy_tcltk(prefix, home_dir, symlink)
  File "c:\users\jeff\appdata\local\programs\python\python35-32\lib\site-packages\virtualenv.py", line 1077, in copy_tcltk
    copyfileordir(srcdir, dstdir, symlink)
  File "c:\users\jeff\appdata\local\programs\python\python35-32\lib\site-packages\virtualenv.py", line 329, in copyfileordir
    shutil.copy2(src, dest)
  File "c:\users\jeff\appdata\local\programs\python\python35-32\lib\shutil.py", line 251, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "c:\users\jeff\appdata\local\programs\python\python35-32\lib\shutil.py", line 114, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'c:\\users\\jeff\\appdata\\local\\programs\\python\\python35-32/tcl/tcl8.6'

1 个答案:

答案 0 :(得分:4)

我通过创建程序所期望的目录来解决这个问题。所以在Python35-32文件夹下,我添加了一个包含tcl8.6和tk8.6文件夹的tcl文件夹。