FreeOpcUa / python-opcua

LGPL Pure Python OPC-UA Client and Server
http://freeopcua.github.io/
GNU Lesser General Public License v3.0
1.36k stars 658 forks source link

Dependency Issues #483

Open bullvai opened 7 years ago

bullvai commented 7 years ago

Hello! I was running an older (8 months ago maybe) version of python-freeopcua and I was having memory leak issues in places where there was spotty wifi connectivity. I just downloaded the newest version because I recall seeing something about a dereferencing issue being fixed, and also it looks like the shelffile has been fixed. However, when I try to run the server-example.py I get a complaint about missing "Objectify." This got me thinking about what dependencies are needed, and what I would need to download and install to get FreeOpcUa up and running using python3 from scratch. Could someone please help my out with my Objectify issue and also provide dependency information for python-opcua?

EDIT: I forgot to mention that the older version of python-freeopcua that I was using didn't require Objectify, which is why I mentioned the older version.

oroulet commented 7 years ago

Looks like you are missing lxml but this should be listed as a dependent in setup.py and readme

bullvai commented 7 years ago

Aw man, I totally missed that... /facepalm

image

On a side note, have you heard of people having memory leak issues when wifi connectivity is spotty?

oroulet commented 7 years ago

No I have not, but I am interested to hear if the newer version helps. Otherwise we can try to find out where the leak is (probably a list we forget to empty somewhere)

oroulet commented 7 years ago

Client or server?

bullvai commented 7 years ago

Server.

zerox1212 commented 7 years ago

pip should automatically install lxml, correct?

bullvai commented 7 years ago

I ended up running into an issue while using pip to install lxml. I'll take a pic with my phone when I get home today - probably about 8 hours from now.

bullvai commented 7 years ago

Here are the issues I had with pip install lxml:

lxml 1

lxml 2

zerox1212 commented 7 years ago

The problem is most likely that you are using the default python packaged with the RPi3 OS which doesn't have as many dev libs.

You probably need to do something like this: sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev

lxml has C dependencies (cause it's way faster when processing XML) and your Linux gcc can't compile it because of the missing libs (but I'm no Linux or gcc expert...) You can see that it's tell you it's missing development packages.

bullvai commented 7 years ago

I just installed the above-mentioned packages and I'm waiting for pip to install lxml. It's been sitting here for quite a while, but I'm hopeful:

image

bullvai commented 7 years ago

Ahhh yeah - slowly but surely, making progress!

image

bullvai commented 7 years ago

image

zerox1212 commented 7 years ago

Probably just need to run it with root permissions
sudo pip install lxml

bullvai commented 7 years ago

I started running it with root permissions before I left the house this morning; hopefully all will be well when I get home.

bullvai commented 7 years ago

lxml installed successfully:

image

... but I'm still getting the same error:

image

zerox1212 commented 7 years ago

Despite what you posted, I have a feeling you installed lxml to python 2.7. It's one of the annoying things about working in RPi, everything defaults to python 2.7.

See if sudo pip3 install lxml works

as a second option you could start the server with python 2.7 instead.

bullvai commented 7 years ago

Hmm okay. To get pip3 I need to sudo apt-get install python3-pip, yeah?

bullvai commented 7 years ago

Awesome - it works! It still complains about cryptography, but I can deal with that. Thank you very much for your help. This project is awesome!

zerox1212 commented 7 years ago

You only need crypto if you are want encryption. It's safe to ignore.

mpf82 commented 7 years ago

Maybe we can get rid of the lxml requirement, see my comment here