IBMStreams/streamsx.documentation

ImportError: No module named 'temperature_sensor_functions'

Closed this issue · 5 comments

I'm trying to follow this guide to submit a simple python application:
http://ibmstreams.github.io/streamsx.documentation/docs/python/1.6/python-appapi-devguide-3/

First, it appears that streamsprofile.sh is setting my PYTHONPATH env var. The guide asks me to 'export' the path myself, which doesn't seem necessary:
_[streamsadmin@nbg-streams-tests python_operator]$ echo $PYTHONPATH

[streamsadmin@nbg-streams-tests python_operator]$ source /opt/ibm/InfoSphere_Streams/current/bin/streamsprofile.sh
IBM Streams environment variables have been set.
[streamsadmin@nbg-streams-tests python_operator]$ echo $PYTHONPATH
/opt/ibm/InfoSphere_Streams/current/toolkits/com.ibm.streamsx.topology/opt/python/packages_

In any case, I've copied the code from the sample on that page and attempted to run. I'm getting an import error on the temperature_sensor_functions module - where does this come from?
$ python3.5 temperature_sensor.py
Traceback (most recent call last):
File "temperature_sensor.py", line 3, in
import temperature_sensor_functions
ImportError: No module named 'temperature_sensor_functions'_

Where is this module supposed to come from? I don't see anything on pip

@ngoracke Try running the sample without the import. I believe some changes were recently made so that that file is not needed anymore, but the sample code in the developer guide was not updated. I have updated the developer guide.
I think you also need to install the dill module from pip.
Hope that helps.

I think I've made it to the next error:

http://pastebin.hursley.ibm.com/10181

Looks like we require python3.x-devel packages, specifically (I believe that's where the -config scripts come from). Doc may need to be updated to reflect that.

 streamtool setproperty --application-ev PYTHONHOME=/usr/lib/python3.5/site-packages/

Looks like a wrong value for PYTHONHOME.

With Anancoda we set it to the location of the Python install, not its packages: e.g. $HOME/anaconda3.

From this, it needs to be the prefix where the libraries are.

https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHOME