无法使用Python 3.7和Anaconda创建VirtualEnv-没有这样的文件或目录:site.py

时间:2019-05-19 21:15:46

标签: python windows anaconda virtualenv conda

尝试在工作中的项目中创建虚拟环境...

conda update virtualenv

virtualenv venv

返回以下内容:

Using base prefix 'C:\\Users\\njho\\Anaconda3'
Traceback (most recent call last):
  File "C:\Users\njho\Anaconda3\Scripts\virtualenv-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Users\njho\Anaconda3\lib\site-packages\virtualenv.py", line 712, in main
    symlink=options.symlink)
  File "C:\Users\njho\Anaconda3\lib\site-packages\virtualenv.py", line 927, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "C:\Users\njho\Anaconda3\lib\site-packages\virtualenv.py", line 1149, in install_python
    writefile(site_filename_dst, SITE_PY)
  File "C:\Users\njho\Anaconda3\lib\site-packages\virtualenv.py", line 363, in writefile
    with open(dest, 'wb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\njho\\Documents\\companyX\\projectX\\venv\\python37.zip\\site.py'

有人知道这里发生了什么吗?我最近刚使用virtualenv没问题。它正在查找的目录在我的项目中,并且尚未创建。

这是崩溃时目录的样子-我们可以看到文件显然不存在...:

enter image description here

谢谢!

0 个答案:

没有答案