Hi - I’ve an issue with a fresh install of grovepi - I can’t access any of the functions from global library.
If I have grovepi.py local then it all works fine. If I don’t, I don’t get an error saying the package can’t be found but I do get errors that the modules (eg. pinMode) can’t be found.
I’ve run a few tests:
$ sudo python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import grovepi
>>> grovepi.__file__
'/usr/local/lib/python2.7/dist-packages/grovepi/__init__.pyc'
>>>
And then:
$ ls -al /usr/local/lib/python2.7/dist-packages/grovepi/
total 48
drwxr-sr-x 2 root staff 4096 Mar 25 12:23 .
drwxrwsr-x 10 root staff 4096 Mar 25 12:23 ..
-rw-r--r-- 1 root staff 14035 Mar 25 12:23 grovepi.py
-rw-r--r-- 1 root staff 12556 Mar 25 12:23 grovepi.pyc
-rw-r--r-- 1 root staff 53 Mar 25 12:23 __init__.py
-rw-r--r-- 1 root staff 305 Mar 25 12:23 __init__.pyc
and yet I’m still getting errors such as:
$ sudo python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import grovepi
>>> grovepi.pinMode(3, "OUTPUT")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'pinMode'
>>>
Has anyone got any suggestions please?
Many thanks
Tom