sherkon18 / python-xbee

Automatically exported from code.google.com/p/python-xbee
MIT License
0 stars 0 forks source link

A small issue with installing the package #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sorry to keep posting here but I decided to get rid of Python 3.x for Python 
2.7 because wxWidgets is only compatible for 2.x and I have to use it for my 
program. So I installed Python 2.7 and pySerial, added C:\Python27 to my path, 
and went to the folder C:\Python27\XBee-2.0.0\ and ran:

python setup.py install

It supposedly installed correctly but then when I tried to run a simple script, 
it fell short with an import error.

Traceback (most recent call last):
  File "C:\Projects\RonakWaspmote\program\python\python27\gui.py", line 2, in <module>
    from xbee import DigiMesh
  File "C:\Python27\lib\site-packages\xbee\__init__.py", line 8, in <module>
    from xbee.ieee import XBee
ImportError: No module named ieee
>>> 

Is this because I still have multiple installations of Python on the computer? 
Python24, Python27, and Python32. Or is this because of some other reason?

I went to C:\Python27\XBee-2.0.0\xbee\ and there were no files with a *.pyc 
extension despite me running "python setup.py install" in the 
C:\Python27\XBee-2.0.0\ directory.

When I install the python-xbee API, this is my output:

C:\Python27\python-xbee>python setup.py install
running install
running build
running build_py
running install_lib
running install_egg_info
Removing C:\Python27\Lib\site-packages\XBee-2.0.0-py2.7.egg-info
Writing C:\Python27\Lib\site-packages\XBee-2.0.0-py2.7.egg-info

R

Original issue reported on code.google.com by ronthecon on 19 Jun 2012 at 6:43

GoogleCodeExporter commented 9 years ago
Why don't you try checking out the latest code from the repository and see if 
that installs correctly? The 2.0.0 version is fairly behind compared to the 
repository; I need to cut a new distributable at some point. Let me know if you 
would like me to zip something up for you.

Also, I've never tried installing the package from within the Python 
installation root. It probably shouldn't make a difference, but you could try 
extracting the package somewhere other than C:/Python27 and see if that helps.

Original comment by pmalms...@gmail.com on 20 Jun 2012 at 1:00

GoogleCodeExporter commented 9 years ago
I downloaded Tortoise SVN and downloaded the latest repository of your xbee 
package in my C:\ directory. And C:\Python27 is in my PATH variable.

I went to my C:\xbee directory (where the repo is located) and ran:
python setup.py install

And it seemed like it installed correctly. Then I ran the example program 
receive_samples.py and it returned this error:

Traceback (most recent call last):
  File "C:\xbee\examples\receive_samples.py", line 13, in <module>
    from xbee import XBee
  File "C:\Python27\lib\site-packages\xbee\__init__.py", line 8, in <module>
    from xbee.impl import XBee
ImportError: No module named impl

How come it doesn't see the impl module?

Original comment by ronthecon on 20 Jun 2012 at 2:45

GoogleCodeExporter commented 9 years ago
I still think you are getting a version that is out of date. Have you tried 
following the instructions on this page 
(http://code.google.com/p/python-xbee/source/checkout) using Mercurial?

Original comment by pmalms...@gmail.com on 20 Jun 2012 at 2:49

GoogleCodeExporter commented 9 years ago
I installed Mercurial and used the hg command on this website to get the latest 
version. I ran the same install command and everything seemed to be compiling 
fine.

I ran the receive_samples.py and this was my output:

Traceback (most recent call last):
  File "C:\xbee\examples\receive_samples.py", line 13, in <module>
    from xbee import XBee
  File "C:\Python27\lib\site-packages\xbee\__init__.py", line 8, in <module>
    from xbee.ieee import XBee
ImportError: No module named ieee

Could this error be caused by multiple Python installations? I have python 2.4, 
2.7, and 3.2. I'm trying to get the latest 2.7 to work so I can use the 
wxPython with pySerial and python-xbee.

Original comment by ronthecon on 20 Jun 2012 at 3:39

GoogleCodeExporter commented 9 years ago
Does the following path exist? "C:\Python27\Lib\site-packages\xbee\ieee.py".

If that's not there, try re-installing from scratch. In the site-packages 
directory for 2.7:

C:\Python27\Lib\site-packages

Remove the folder called xbee and the file called XBee-2.0.0-py2.7.egg-info.

Then re-run the install script explicitly with Python 2.7 from the place you 
checked out the source code with Mercurial:

C:\xbee>C:\Python27\python.exe setup.py install

You should see a bunch of lines printed to the console indicating that files 
are being copied and byte-compiled if the installation worked properly.

You can test the installation by explicitly starting Python 2.7:

C:\Python27\python.exe

and attempting:

import xbee

Original comment by pmalms...@gmail.com on 20 Jun 2012 at 3:56

GoogleCodeExporter commented 9 years ago
Perfect. That new installation worked then I just had to copy the digimesh.py 
file over to C:\python-xbee\xbee\ and change __init__.py to include:

from xbee.digimesh import DigiMesh

And everything worked. Thanks again!

Original comment by ronthecon on 20 Jun 2012 at 4:38

GoogleCodeExporter commented 9 years ago
My pleasure; I'm glad to hear that that took care of your problem. Your prior 
installation must have been slightly messed up somehow.

Original comment by pmalms...@gmail.com on 21 Jun 2012 at 12:36