Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named slackclient #26

Open
karpantschof opened this issue Jul 29, 2016 · 7 comments
Open

No module named slackclient #26

karpantschof opened this issue Jul 29, 2016 · 7 comments

Comments

@karpantschof
Copy link

Once install script is completed and token added to settings.py, upon 'python main.py' command:

Traceback (most recent call last):
File "main.py", line 15, in
import slackclient #for real time parts
ImportError: No module named slackclient

If running with python3:

File "main.py", line 84
print "Connection Failed, invalid token?"
^
SyntaxError: Missing parentheses in call to 'print'

Token is correct and tested on other app.

@yigitozkavci
Copy link
Contributor

First of all, project is written in python 2, hence python 3 is not supported (yet).
slackclient is a requirement which is mentioned in requirements.txt file. Are you sure you successfully executed setup.sh or setup-linux.sh whichever suits to your os?

@priezz
Copy link

priezz commented Jul 30, 2016

Same for me. Running OS X. setup.sh completed successfully.

@yigitozkavci
Copy link
Contributor

Can you please provide the output of your setup.sh execution? I am thinking of python version mismatch. Project is assuming you have 2.7 version to run with virtualenv.

@priezz
Copy link

priezz commented Jul 30, 2016

I have found the source of the problem. In the env/bin/active you are manipulating with the environment. After commenting it and changing pip to pip2 in the setup script it correctly installed the deps.

One more thing. When I successfully started the main.py I got the following output above the slack command prompt:

Ignoring charlock_holmes-0.7.3 because its extensions are not built.  Try: gem pristine charlock_holmes --version 0.7.3
Ignoring escape_utils-1.1.0 because its extensions are not built.  Try: gem pristine escape_utils --version 1.1.0
Ignoring rugged-0.24.0 because its extensions are not built.  Try: gem pristine rugged --version 0.24.0
/usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'lolcat' (>= 0.a) among 59 total gem(s) (Gem::LoadError)

So, these four gem commands are to be included into setup script as well:

gem pristine charlock_holmes escape_utils rugged
gem install lolcat # w/o sudo

@priezz
Copy link

priezz commented Jul 30, 2016

» ./setup.sh                                                                                                                                                                                                                                                                    V master ✱
Running virtualenv with interpreter /usr/local/bin/python2.7
New python executable in /private/tmp/Slack-Gitsin/env/bin/python2.7
Not overwriting existing python script /private/tmp/Slack-Gitsin/env/bin/python (you must use /private/tmp/Slack-Gitsin/env/bin/python2.7)
Installing setuptools, pip, wheel...done.
Requirement already satisfied (use --upgrade to upgrade): argparse==1.2.1 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): backports.ssl-match-hostname==3.5.0.1 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): click==6.6 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): prettytable==0.7.2 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): prompt-toolkit==1.0.3 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade): requests==2.10.0 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 6))
Requirement already satisfied (use --upgrade to upgrade): six==1.10.0 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 7))
Requirement already satisfied (use --upgrade to upgrade): slackclient==1.0.0 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 8))
Requirement already satisfied (use --upgrade to upgrade): wcwidth==0.1.6 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 9))
Requirement already satisfied (use --upgrade to upgrade): websocket-client==0.37.0 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 10))
Requirement already satisfied (use --upgrade to upgrade): wsgiref==0.1.2 in /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7 (from -r requirements.txt (line 11))
Requirement already satisfied (use --upgrade to upgrade): pygments==2.1.3 in ./env/lib/python2.7/site-packages (from -r requirements.txt (line 12))
Password:
Successfully installed lolcat-42.1.43
Parsing documentation for lolcat-42.1.43
Done installing documentation for lolcat after 0 seconds
1 gem installed

@yigitozkavci
Copy link
Contributor

Hmm. Sounds reasonable to me. Not sure which of these packages require charlock_holmes escape_utils rugged as dependencies tho, and we only need lolcat gem as, you know, gem.

And for those modifications to the setup script, that makes sense not to use sudo for gem install command. You can modify it and send a pr to contribute, thanks for your helpful report! :)

@Legionivo
Copy link

Legionivo commented Aug 12, 2016

I got the same error. Just forgot to activate env (. env/bin/activate) and then run main.py. Do it and you won't get this error!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants