Search code examples
pythonvolttron

Packaging an Agent in Volttron


We are trying to package an agent. These are the steps we have done:

cd volttron //go to volttron directory
source env/bin/activate //activate the terminal
volttron-pkg package examples/thermoWrite //package the agent we wrote

Here is the error message comes out:

(volttron)pi@raspberrypi:~/volttron $ volttron-pkg package examples/thermoWrite
Traceback (most recent call last):
File "setup.py", line 78, in <module>
_temp = __import__(agent_module, globals(), locals(), ['__version__'], -1)
File "/tmp/tmpI0zsTG/pkg/Agent/agent.py", line 7, in <module>
import psycopg2
ImportError: No module named psycopg2
2017-03-21 17:55:05,988 () volttron.platform.packaging ERROR: Command
'['/home/pi/volttron/env/bin/python', 'setup.py', '--no-user-cfg', '--quiet', 
'bdist_wheel']' returned non-zero exit status 1

I did install psycopg2 in my system, using command: sudo apt-get install python-psycopg2 in terminal For my understanding is we miss the module psycopg2 inside the volttron. But we have no idea how to install a module inside the volttron. We have tried copy and paste module file into ./volttron/env/lib/python2.7/site-packages, it seems not working. Someone please help. Thanks.


Solution

  • With the VOLTTRON environment activated run:

    pip install psycopg2
    

    That will install the python module that it is trying to import.