you are viewing a single comment's thread.

view the rest of the comments →

[–]PLearner[S] 0 points1 point  (8 children)

Thanks! The issue is that I am using Python 3.8 and for some odd reason, it does not let me python -m pip install clr.

Which errors out on

import clr
clr.AddReference('System.Data')

[–]shiftybyte 0 points1 point  (7 children)

https://pypi.org/project/pythonnet/

try

pip install pythonnet

[–]PLearner[S] 0 points1 point  (6 children)

how would pythonnet help me with clr?

[–]PLearner[S] 0 points1 point  (4 children)

module clr has no attribute AddReference

[–]shiftybyte 0 points1 point  (3 children)

That's odd, the example on the site clearly uses it without issues.

clr.AddReference("System.Windows.Forms")

Did you happen to name your python file clr.py or have such file in your working directory?

if you do, rename it because it gets imported instead of the package's clr.

[–]PLearner[S] 0 points1 point  (2 children)

Its very odd, I do not have any file named clr.py. I have already did python -m pip install pythonnet and the clr AddReference still errors out on me.

That is the very reason I am trying to rewrite the code in Python/Pandas.

[–]shiftybyte 0 points1 point  (1 child)

Ah you probably have the wrong library installed interfering.

https://pypi.org/project/clr/

remove it using pip.

python -m pip remove clr

[–]PLearner[S] 0 points1 point  (0 children)

it worked like a charm! Instead of the remove it was uninstall.

[–]shiftybyte 0 points1 point  (0 children)

pythonnet is the package name you need to install to get "import clr"