Clr import system no module named System

See original GitHub issue

Hi guys,

I’m trying to use to do an import System in my python code but it won’t work.

Here is what I do: Import clr Import System

inportError: No module named System

So I tried a clr.AddReference, same thing, "AttributeError: ‘module’ object has no attribute ‘AddReference’

Have you guys already had this pb ? Do you need more info ?

Thanks in advance

Environment

  • Pythonnet version: 2.2.2
  • Clr version 1.0.2
  • Python version: 2.7.1 anaconda 2.4.1
  • Operating System: windows

Details

    print('TODO')
  • If there was a crash, please include the traceback here.
    print('TODO')

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
denfromufacommented, Feb 17, 2017

Where did you get this Clr version 1.0.2? Is it this package?

https://pypi.python.org/pypi/clr/1.0.3

If yes, you need to uninstall this clr package to use pythonnet, because both packages have a name clash.

On Thu, Feb 16, 2017, 8:27 PM satanasss notifications@github.com wrote:

Hi guys,

I’m trying to use to do an import System in my python code but it won’t work.

Here is what I do: Import clr Import System

inportError: No module named System

So I tried a clr.AddReference, same thing, "AttributeError: ‘module’ object has no attribute ‘AddReference’

Have you guys already had this pb ? Do you need more info ?

Thanks in advance Environment

  • Pythonnet version: 2.2.2
  • Clr version 1.0.2
  • Python version: 2.7.1 anaconda 2.4.1
  • Operating System: windows

Details

Describe what you were trying to get done.

TODO

What commands did you run to trigger this issue? If you can provide a Minimal, Complete, and Verifiable example http://stackoverflow.com/help/mcve this will help us understand the issue.

print('TODO')
  • If there was a crash, please include the traceback here.
print('TODO')

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pythonnet/pythonnet/issues/388, or mute the thread https://github.com/notifications/unsubscribe-auth/AHgZ5aYSfKUmewxvv-Jj6iizDFPiRW1Sks5rdQWjgaJpZM4MDzI9 .

1reaction
denfromufacommented, Feb 17, 2017

You can also try using importlib to import clr from pythonnet with full path provided to clr.pyd.

On Thu, Feb 16, 2017, 8:35 PM Denis Akhiyarov denis.akhiyarov@gmail.com wrote:

Where did you get this Clr version 1.0.2? Is it this package?

https://pypi.python.org/pypi/clr/1.0.3

If yes, you need to uninstall this clr package to use pythonnet, because both packages have a name clash.

On Thu, Feb 16, 2017, 8:27 PM satanasss notifications@github.com wrote:

Hi guys,

I’m trying to use to do an import System in my python code but it won’t work.

Here is what I do: Import clr Import System

inportError: No module named System

So I tried a clr.AddReference, same thing, "AttributeError: ‘module’ object has no attribute ‘AddReference’

Have you guys already had this pb ? Do you need more info ?

Thanks in advance Environment

  • Pythonnet version: 2.2.2
  • Clr version 1.0.2
  • Python version: 2.7.1 anaconda 2.4.1
  • Operating System: windows

Details

Describe what you were trying to get done.

TODO

What commands did you run to trigger this issue? If you can provide a Minimal, Complete, and Verifiable example http://stackoverflow.com/help/mcve this will help us understand the issue.

print('TODO')
  • If there was a crash, please include the traceback here.
print('TODO')

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pythonnet/pythonnet/issues/388, or mute the thread https://github.com/notifications/unsubscribe-auth/AHgZ5aYSfKUmewxvv-Jj6iizDFPiRW1Sks5rdQWjgaJpZM4MDzI9 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

python 3.x - No module named 'System'
If you want it called System with a capital S (maybe for backward compatability with already-written programs?), use from os import system ......
Read more >
No module named 'clr' error - Support
I tried to import pythonnet by using: pip_install('pythonnet'). ... Any idea that can be helful? ... Does installing pythonnet in a system python...
Read more >
No module named error for pythonnet package : PY-60225
There is no package for System - that is a .NET CLR namespace, made available for import by clr.AddReference('System') .
Read more >
Importing Modules
NET required you to import modules through a special top-level package named CLR . This is no longer required, though the syntax is...
Read more >
[Python.NET] Some super basic/possibly stupid question
Then I type: from System import String 5. And I get the error: No module named System. L Which is true, there are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found