Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandas import error when debugging using PVTS

I am dealing with a very silly error, and wondering if any of you have the same problem. When I try to import pandas using import pandas as pd I get an error in copy.py. I debugged into the pamdas imports, and I found that the copy error is thrown when pandas tries to import this:
from pandas.io.html import read_html
The exception that is throwns is:

un(shallow)copyable object of type <type 'Element'>

I do not get this error if I try to straight up run the code and not use the PVTS debugger. I am using the python 2.7 interpreter, pandas version 0.12 which came with the python xy 2.7.5.1 distro and MS Visual Studio 2012.

Any help would be appreciated. Thanks!

like image 924
joeP Avatar asked Dec 12 '13 00:12

joeP


1 Answers

This is a limitation of the way PTVS detects unhandled exceptions - it can't see the except-block that's going to catch this exception because it is in the code that is eval'd from a string. See the bug in the tracker for more details.

As a workaround, disable "Debug standard library" checked in Tools -> Options -> Python Tools -> Debugging - this should cause the exception to be ignored.

like image 134
Pavel Minaev Avatar answered Sep 26 '22 01:09

Pavel Minaev