Closed Luis-Palacios closed 8 years ago
Do you have Python 3.4 installed? We should be a bit flexible with respect to the paths, but if it isn't detected at all then it may not work.
Yes, i do, is right there:
Same problem here.
I am also getting this issue in VS 2015 when trying to add a virtual environment (Python 2.7). Tried using the latest version of PTVS available (2.2.2), with the same result.
Hmm, I also get an error when trying to create a brand-new one:
Virtual environment is being created at 'F:\Programs\maya-viewport-render-plugin\virtualenv'
C:\Python27\python.exe: No module named venv
Virtual environment was not created at 'F:\Programs\maya-viewport-render-plugin\virtualenv'. Exit code: 1
System.InvalidOperationException: Virtual environment was not created at 'F:\Programs\maya-viewport-render-plugin\virtualenv'
at Microsoft.PythonTools.Project.VirtualEnv.<ContinueCreate>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PythonTools.Project.PythonProjectNode.<CreateOrAddVirtualEnvironment>d__148.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PythonTools.Project.AddVirtualEnvironmentOperation.<Run>d__10.MoveNext()
I can confirm that this also only occurs with PTVS for VS 2015; my 2013 PTVS still seems to be working fine for now. I have had to revert to using VS 2013; if any advice could be provided on why this might be happening, it would be greatly appreciated! Thanks!
The first two reports seem to suggest that Python has not bee installed in a way that can be detected by PTVS. If you could paste the info from Tools, Python Tools, Diagnostic Info into a gist or email it to ptvshelp@microsoft.com I can confirm this for you and suggest a workaround. (Potentially the 32/64-bitness of the installed Python differs from the virtual environment - I don't recall whether we check that at this stage.)
@sonictk - you are hitting a separate issue where we detect a venv
module that doesn't actually work for creating virtual environments. Ensure your completion DB is up to date, and if you could check to see what - if anything - you have installed at C:\Python27\Lib\site-packages\venv
(perhaps venv.py
) or C:\Python27\Lib\venv
that may be relevant. (I thought I'd fixed this for 2.2.2 when nothing is installed, but perhaps it missed the release. Been a while since I've looked at this - I've been on vacation.)
@zooba Hey, thanks for the quick response! I don't seem to have anything of the sort located at the Python packages folder with venv
at all:
http://imgur.com/qu8jYNL http://imgur.com/9XgsUul
I am also running into the first issue where I cannot add an existing virtual environment with the error that it cannot find a base interpreter at C:\Python27
.
I have uploaded the diagnostic info into a gist available at the following location: https://gist.github.com/sonictk/e78b36041bfd0f6d005f
The installed Python and that of the virtual environment are both 64-bit; I can confirm this by opening interactive shells in both of them. The funny thing is, in Visual Studio itself I can also open an interactive Python 2.7 shell, so clearly it's able to find the interpreter at the path...just not use it to create a virtual environment, it seems. Again, this is only happening on VS 2015.
Hope that helps!
Hmm, I wonder if we're getting confused by the venv
environment? I don't see anything else particularly concerning in the logs, apart from the two failures.
We didn't get the detailed logs for that environment because it isn't loaded. Can you see if the file C:\Programs\maya-viewport-render-plugin\venv\.ptvs\AnalysisLog.txt
exists and share that? It appears to be intermittently working against Python 2.7.
Or maybe you have C:\Programs\maya-viewport-render-plugin
in %PATH%
or %PYTHONPATH%
? That might potentially cause a problem.
Hi @zooba:
The AnalysisLog.txt
is available at the following location:
https://gist.github.com/sonictk/ac44d906d65fda27155c
Looking at it, I'm not quite sure of the signifcance of the errors thrown here:
IOError: [Errno 13] Permission denied: 'C:\\Programs\\maya-viewport-render-plugin\\venv\\.ptvs\\__builtin__.idb'
2015-12-08T20:28:06: [ERROR] Failed to scrape builtin modules (Exit Code: 1)
2015-12-08T20:28:06: [ERROR] Analysis failed
(Not sure why the permission errors are occurring...)
And I'm pretty aware of my PATH
and PYTHONPATH
pretty clean when it comes to tools development. :) But just to be sure:
λ echo %PATH%
C:\Utilities\cmder\bin;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\share\vim\vim74;C:\Utilities\cmder\vendor\conemu-maximus5;C:\Utilities\cmder\vendor\conemu-maximus5\ConEmu;C:\Utilities\cmder;C:\ProgramData\Oracle\Java\javapath;C:\Programs\opencv\build\x64\vc12\bin;C:\Program Files (x86)\Graphviz2.38\bin;C:\Program Files\NOITOM\Axis Neuron\;C:\ffmpeg\bin;C:\MinGW\msys\1.0\bin;C:\MinGW\bin;C:\windows\system32\blur64;C:\Python27\Scripts;C:\Python27;C:\Program Files (x86)\Git\cmd;C:\Python26\Lib\site-packages\PyQt4;C:\Python33\Lib\site-packages\PyQt5;C:\Python27\Lib\site-packages\PyQt4;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft Research KinectSDK\;C:\Program Files (x86)\GNU\GnuPG\pub;C:\Program Files (x86)\NVIDIA Corporation\Cg\bin;C:\Program Files\Common Files\Softimage;C:\Program Files (x86)\Common Files\Autodesk Shared\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files\Mercurial\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\doxygen\bin;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Havok\2014.1.1\AnarchySDK\Bin\win32_vs2010_anarchy\dev\DX9;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Program Files (x86)\Brackets\command;C:\Windows\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.4
λ echo %PYTHONPATH%
C:\Users\sonictk\Autodesk\exocortex_workgroup\Workgroup\pythonlibs;C:\Python27\
EDIT: I forgot to add in my previous comment, I've also ensured that all the completion DBs are up to date as well.
EDIT2: I tried deleting venv
and creating a new virtual environment manually from the command line with the name theenv
, and tried to add it in PTVS. That also failed with the same error regarding not being able to find the base interpreter at C:\Python27
as well.
The permission errors may be due to a race between VS and the analyzer trying to open the file at the same time.
Also, I'm afraid your PATH
and PYTHONPATH
don't look that clean to me :( though it's hard to tell how much is globally set and how much is due to your shell.
Having anything before Windows\System32
in PATH
is generally a bad idea, since that can lead to system DLLs being masked by installed ones. It's not so easy to deal with though, so you just have to be careful (or hope) that nothing there has old copies of system DLLs.
It's also a bad idea to include a Python install directory in PYTHONPATH
. When that version of Python is run, the directory is automatically added, and if you're running a different version then you certainly don't want it in there.
But, neither of these is likely to be the main problem. I'll have to do some digging through our code to come up with some other ideas for how this is going wrong. I'll get back to you when I can (just got back from a long vacation - plenty of other things have stacked up :) )
I'm also facing same issue;
Diagnostic Info 2016-03-02T200908.txt
Virtual environment is being created at 'C:\workspace\app-toolbox\python\env.vs'
New python executable in C:\workspace\app-toolbox\python\env.vs\Scripts\python.exe
Installing setuptools, pip, wheel...done.
Virtual environment was successfully created at 'C:\workspace\app-toolbox\python\env.vs'
This may be due to #1097, which was just fixed in the latest dev build released today. Can you try that out and see if the problem is fixed?
Well done @zooba, that latest build fixed this issue. You can close #994 too.
I am using the vs2013. Does this mean that I must update to the lastest vs2015 and update the PTVS dev to solve this issue?
Many thanks.
Yes. Alternatively, there's a workaround in #1097 that you can use without updating.
Hi guys, i'm using microsoft visual studio 2015 and facing the same problem that unable to add existing virtualenv. I do not know why mine is so different the others. I dont have any windows batch file.
@ireneyufa93 You've installed IronPython but probably need CPython from www.python.org instead.
When trying too add an existing virtual env, i get a we could not find a bse interpreter at C:\Python34
even if i create the virtual env using the add virtual env option it get added but if i remove it and try to add it again using the add existing option i get the same error