Pyramid Issue

Sep 9, 2011 at 1:04 AM

I'm trying to use pyramid with pytools, but I'm getting this error:


Traceback (most recent call last):

  File "build/bdist.linux-i686/egg/", line 2288, in insert_on

    np = npath.index(nloc, p+1)

ValueError: 'c:\\pyramid_env\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg' is not in list"


It does this for each item in the site-packages directory.  I have to press continue through each one, and if I do it for every one (it takes a while), python will actually launch and the code works.


Also, intellisense on pyramid isn't working either.  Any ideas?

Sep 9, 2011 at 1:12 AM

For the first issue you can bring up the exceptions window (Debug->Exceptions->Python Exceptions) and disable breaking when ValueError is thrown.  If you see only a single column for thrown then you have Just My Code disabled.  You can enable that in Tools->Options->Debugging->General.  Then you'll get a "User unhandled" column and in general the experience is a little nicer.  If you already have JMC enabled then likely the exception is being implicitly handled somewhere - if you could look up the call stack and see where that's happening and report it back that'd help us improve this in the future.

As for intellisense, does pyramid live within c:\\pyramid_env\\lib\\site-packages somewhere?  It could be taking a little while for the analysis to run (you can check and see if there's a Microsoft.PythonTools.Analyzer process is running).  If it's actually located somewhere else then you probably need to add it to your search paths in your project.

Sep 10, 2011 at 3:17 PM

Disabling the ValueError fixed it up!  Could there be a potential issue in the future since I've disabled this, and if so what should I look out for?

As for the intellisense, pyramid does live it the path you mentioned, however I ended up just adding the direct path to pyramid in the search paths, and it's working great now!

Thank you for your quick response, it's much appreciated! ;p

Sep 10, 2011 at 4:58 PM

The only issue w/ disabling ValueError is if you want to break on that exception in the future (because your program is throwing it) then that won't happen.  But you can always re-enable it at that point (presumably after the startup where it's being thrown a lot).

Sep 10, 2011 at 5:58 PM

Getting the intellisense to pick up pyramid using the search path works, but now when I try to Ctrl-F5 it's saying "The parameter is incorrect".  Yet when I just F5 for debug it works fine.  


Using the search path like this also has prevented the interactive window from working.  The initial output of the interactive window when it attempts to start up is:

"Failed to start interactive process: 

System.ComponentModel.Win32Exception (0x80004005): The parameter is incorrect   

at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)   

at System.Diagnostics.Process.Start() 

at Microsoft.PythonTools.Repl.PythonReplEvaluator.Connect()"


Any Ideas?

Sep 13, 2011 at 12:19 AM

Actually it seems as though the intellisense isn't working at all.  When I added the search paths, the modules appear under intellisense, but only for importing them.  When actually trying to use those imports, the intellisense doesn't show.  I'm using a virtualenv created directly on the c drive.  Does using the python interpreter through the virtualenv work with pytools?

Sep 13, 2011 at 4:12 AM

Did PTVS pick up your virtualenv install automatically or did you need to configure it in Tools->Options->Python Tools->Interpreter Options?  If you configured it what's the value for Path Environment Variable when you select the virtualenv install in Show settings for?

Also, if you go to the project properties page what's the string in Debug->Search Paths? 

I'm guessing one of those has something wrong with them which is causing the exception but if that's the case we should handle it more gracefully.

Regarding the intellisense, what's the icon for the modules look like?  Are they little blue blocks or are they more like a bunch of dots connected by lines? 

We actually haven't done any virtualenv testing but basically a Python distro is a Python distro to us.  As long as it has an EXE that we can start with a script then that's all we require (the only exceptions to this being profiling and attach to process, which both require the CPython embedding API). 

Sep 13, 2011 at 10:06 PM

I set up the virtual environment after the fact, so PTVS didn't originally have it to work with.  Currently my Path Environment Variable is empty, as I'm unsure what this should be set to.

My virtual env is located at C:\pyramid_blog\BlogSolution\environment and contains the Include, Lib, and Scripts folders.

My Python install itself is located at C:\Python27.

I'm just adding those locations in case you need them for future reference.


Also, the modules that appear are little blue blocks, and I've cleared out the Debug->Search Paths.

Sep 13, 2011 at 10:31 PM

Can you change the Path Environment Variable to PYTHONPATH and see if that fixes the start issue?



Sep 13, 2011 at 11:07 PM

Yep, it fixes the start issue when I have the search paths set.  Intellisense still isn't working.

Sep 14, 2011 at 4:19 PM

So you're adding C:\pyramid_env\Lib to the search paths?  I think if you add Pyramid directly to the search paths like:


Then I think you'll get intellisense against it.

We should be able to cache that and pick it up from the interpreter configuration instead - but in a virtualenv install the EXE is in "C:\pyramid_env\Scripts" and we can't find the Lib dir.   I've opened this issue to fix that:  So this is an issue w/ us not working correctly w/ virtualenv installs.  Thanks for the report and let me know if changing the search path doesn't fix it.