I started with this page: http://community.cosm.com/node/114
The code works will on python (version 2.7.3rc2) but I would like to try python3. I am very new to python and I'm not sure why python3 is better but having been released in 2008 it seems worth a try.
I've installed the prerequisites including lxml then ran python3 setup.py install this is the result:
- Code: Select all
sudo apt-get install python3-lxml
...
pi@raspberrypi ~ $ git clone git://github.com/petervizi/python-eeml.git
Cloning into 'python-eeml'...
remote: Counting objects: 197, done.
remote: Compressing objects: 100% (131/131), done.
remote: Total 197 (delta 82), reused 160 (delta 50)
Receiving objects: 100% (197/197), 44.63 KiB, done.
Resolving deltas: 100% (82/82), done.
pi@raspberrypi ~ $ cd python-eeml/
pi@raspberrypi ~/python-eeml $ sudo python3 setup.py install
running install
Checking .pth file support in /usr/local/lib/python3.2/dist-packages/
/usr/bin/python3 -E -c pass
TEST PASSED: /usr/local/lib/python3.2/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
creating python_eeml.egg-info
writing requirements to python_eeml.egg-info/requires.txt
writing python_eeml.egg-info/PKG-INFO
writing top-level names to python_eeml.egg-info/top_level.txt
writing dependency_links to python_eeml.egg-info/dependency_links.txt
writing manifest file 'python_eeml.egg-info/SOURCES.txt'
reading manifest file 'python_eeml.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'python_eeml.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv6l/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/eeml
copying eeml/datastream.py -> build/lib/eeml
copying eeml/__init__.py -> build/lib/eeml
creating build/bdist.linux-armv6l
creating build/bdist.linux-armv6l/egg
creating build/bdist.linux-armv6l/egg/eeml
copying build/lib/eeml/datastream.py -> build/bdist.linux-armv6l/egg/eeml
copying build/lib/eeml/__init__.py -> build/bdist.linux-armv6l/egg/eeml
byte-compiling build/bdist.linux-armv6l/egg/eeml/datastream.py to datastream.cpython-32.pyc
byte-compiling build/bdist.linux-armv6l/egg/eeml/__init__.py to __init__.cpython-32.pyc
File "build/bdist.linux-armv6l/egg/eeml/__init__.py", line 420
Unit.__init__(self, 'Celsius', 'derivedSI', u'\xb0C')
^
SyntaxError: invalid syntax
creating build/bdist.linux-armv6l/egg/EGG-INFO
copying python_eeml.egg-info/PKG-INFO -> build/bdist.linux-armv6l/egg/EGG-INFO
copying python_eeml.egg-info/SOURCES.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
copying python_eeml.egg-info/dependency_links.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
copying python_eeml.egg-info/not-zip-safe -> build/bdist.linux-armv6l/egg/EGG-INFO
copying python_eeml.egg-info/requires.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
copying python_eeml.egg-info/top_level.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
creating dist
creating 'dist/python_eeml-1.2.0-py3.2.egg' and adding 'build/bdist.linux-armv6l/egg' to it
removing 'build/bdist.linux-armv6l/egg' (and everything under it)
Processing python_eeml-1.2.0-py3.2.egg
removing '/usr/local/lib/python3.2/dist-packages/python_eeml-1.2.0-py3.2.egg' (and everything under it)
creating /usr/local/lib/python3.2/dist-packages/python_eeml-1.2.0-py3.2.egg
Extracting python_eeml-1.2.0-py3.2.egg to /usr/local/lib/python3.2/dist-packages
File "/usr/local/lib/python3.2/dist-packages/python_eeml-1.2.0-py3.2.egg/eeml/__init__.py", line 420
Unit.__init__(self, 'Celsius', 'derivedSI', u'\xb0C')
^
SyntaxError: invalid syntax
python-eeml 1.2.0 is already the active version in easy-install.pth
Installed /usr/local/lib/python3.2/dist-packages/python_eeml-1.2.0-py3.2.egg
Processing dependencies for python-eeml==1.2.0
Searching for lxml==2.3.2
Best match: lxml 2.3.2
Adding lxml 2.3.2 to easy-install.pth file
Using /usr/lib/python3/dist-packages
Finished processing dependencies for python-eeml==1.2.0
The same process is working for python but not python3
When I try to run import eeml in python 3 I get:
- Code: Select all
Python 3.2.3 (default, Jul 6 2012, 13:39:51)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import eeml
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "eeml/__init__.py", line 420
Unit.__init__(self, 'Celsius', 'derivedSI', u'\xb0C')
^
SyntaxError: invalid syntax
>>>
I am using the new Raspbian wheezy image. I have done a search using Google and the forum search for "Unit.__init__(self, 'Celsius', 'derivedSI', u'\xb0C')" but I didn't find anything.
Thanks for any help or ideas.