Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No name 'ua' in module 'opcua' #1066

Closed
xuplus6493 opened this issue Jun 5, 2020 · 24 comments
Closed

No name 'ua' in module 'opcua' #1066

xuplus6493 opened this issue Jun 5, 2020 · 24 comments

Comments

@xuplus6493
Copy link

xuplus6493 commented Jun 5, 2020

Hello,
I have install opcua
but when I use this code by Visual Code (Python 3.8.2 32bit)
from opcua import Client,ua
I get the problem

No name 'ua' in module 'opcua' (no-name-in-module)
image

How can I fix it ?

@AndreasHeine
Copy link
Member

AndreasHeine commented Jun 5, 2020

have you checked the folders? C:\Users<your login>\AppData\Local\Programs\Python\Python38\Lib\site-packages\opcua
folder

@oroulet
Copy link
Member

oroulet commented Jun 5, 2020

Your installation is completely broken. Try again

@xuplus6493
Copy link
Author

xuplus6493 commented Jun 5, 2020

have you checked the folders? C:\Users\AppData\Local\Programs\Python\Python38\Lib\site-packages\opcua
folder

yes,I have this folder

image

@xuplus6493
Copy link
Author

Your installation is completely broken. Try again

I have try
pip uninstall opcua
pip install opcua

@AndreasHeine
Copy link
Member

(-_-) do you have python 2 also installed ?

@xuplus6493
Copy link
Author

(-_-) do you have python 2 also installed ?

no, only python 3

@AndreasHeine
Copy link
Member

have you tried comandprompt with admin priviliges and then => python -m pip uninstall opcua => python -m pip install opcua

@xuplus6493
Copy link
Author

have you tried comandprompt with admin priviliges and then => python -m pip uninstall opcua => python -m pip install opcua

I did, but it's not working

image

@xuplus6493
Copy link
Author

Your installation is completely broken. Try again

I have reinstall python, visual code and opcua ...

@AndreasHeine
Copy link
Member

and? win/fail?

@xuplus6493
Copy link
Author

fail ...

@AndreasHeine
Copy link
Member

open python shell:
print( help('modules'))

@xuplus6493
Copy link
Author

xuplus6493 commented Jun 5, 2020

open python shell:
print( help('modules'))

image
image

@AndreasHeine
Copy link
Member

if u use pythons builtin IDE -> "idle" does it also blame that there is no "ua"

@xuplus6493
Copy link
Author

if u use pythons builtin IDE -> "idle" does it also blame that there is no "ua"
image

@xuplus6493
Copy link
Author

xuplus6493 commented Jun 5, 2020

I want to write Tag (kepware server)
the same code is working in another computer
image

@AndreasHeine
Copy link
Member

yeah because ua.VariantType.Double is missing... then you'll get BadTypeMismatch !!!

@xuplus6493
Copy link
Author

yeah because ua.VariantType.Double is missing... then you'll get BadTypeMismatch !!!

How to get ua.VariantType.Double ?

my tag data type is "Double"

@AndreasHeine
Copy link
Member

AndreasHeine commented Jun 5, 2020

you will not like my answer...

from opcua import ua

opcua datatypes and python datatypes are different so you have to be specific what opcuatype you want to set!

"var = 1" is an Python int => OPCUA Int 64

@xuplus6493
Copy link
Author

you will not like my answer...

from opcua import ua

image

@xuplus6493
Copy link
Author

opcua datatypes and python datatypes are different so you have to be specific what opcuatype you want to set!

"var = 1" is an Python int => OPCUA Int 64

But, the same code is working in another computer....

@AndreasHeine
Copy link
Member

AndreasHeine commented Jun 5, 2020

well then its more likely your pc is the problem... sorry

@xuplus6493
Copy link
Author

well then its more likely your pc is the problem... sorry

Thank you for your help !

@xuplus6493
Copy link
Author

I solve this problem !!
pip install copyright

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants