Closed tgorup closed 10 years ago
Was running python2.6, thought that may have been the issue. Did an altmake for Python2.7, forced pip to install to 2.7's site-packages, and I'm still getting the above error.
@tgorup curious; i've not seen that error before. my first guess is that there's a permissions issue somewhere in the deployed environment -- especially since it seems to work on your local machine. can you try sudo pip install
on the target machine (or is this restricted to a virtual env?).
I tried the sudo pip install
and it says it's already installed. Also tried using --ignore-installed
. Still doesn't appear to be working. I think you might be right that it's a permissions issue. But I'm unfortunately not seeing where it could be. I attempted all of this as root. What's odd is it isn't breaking on the import, but rather on the execution.
$ sudo pip install python-simple-hipchat
Requirement already satisfied (use --upgrade to upgrade): python-simple-hipchat in /usr/lib/python2.6/site-packages
Cleaning up...
$ sudo pip install --ignore-installed python-simple-hipchat
Downloading/unpacking python-simple-hipchat
Downloading python-simple-hipchat-0.2.tar.gz
#!/usr/bin/python
Running setup.py (path:/tmp/pip_build_root/python-simple-hipchat/setup.py) egg_info for package python-simple-hipchat
Installing collected packages: python-simple-hipchat
Running setup.py install for python-simple-hipchat
Removing /usr/lib/python2.6/site-packages/python_simple_hipchat-0.2-py2.6.egg-info
Successfully installed python-simple-hipchat
Cleaning up...
$ ./t.py Testing
Traceback (most recent call last):
File "./t.py", line 9, in <module>
hipster = hipchat.HipChat(token='APITOKENHERE') # For notification only
AttributeError: 'module' object has no attribute 'HipChat'
t.py code:
#!/usr/bin/python
import hipchat
import sys
import ast
messageinput = sys.argv[1] # Take message
hipster = hipchat.HipChat(token='APIKEYHERE') # For notification only
# Post to Room
hipster.method('rooms/message', method='POST', parameters={'room_id': 'ROOMNUM', 'from': 'userBot', 'message': '%s' % (messageinput), 'notify': '0', 'color': 'green'} )
@tgorup it sounds like you might have a conflicting module with the same name. Do you have a python file in the same directory as t.py
named hipchat.py
?
Or try this:
import hipchat
print hipchat.__file__
to make sure you are loading the right thing.
closing; this appears to be an environment-specific error
I'm not sure what I'm doing wrong exactly. Possibly I'm doing my initial import/install wrong? Running the follow script:
I receive the following error:
And
I'm running this on CentOS:
Tried pip install:
Also tried installing from git:
Had my initial testing running perfectly on OSx. Please let me know if you need any other info.