ModuleNotFoundError: No module named 'slack'

See original GitHub issue

Couldn’t find module named ‘slack’ after I pip3 install slackclient.

$ pip3 list
Package        Version
-------------- -------
...
slack          0.0.2
slackclient    2.5.0
...
$ python3
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import slack
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'slack'
>>> exit()

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
koenzhaocommented, May 3, 2020

At least having slack PyPI package prevents you from loading slack package after resolving the issue described here. So, please uninstall it anyways.

>>> import slack
>>> from slack import WebClient
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'WebClient' from 'slack' (/Users/ksera/.pyenv/versions/3.8.2/lib/python3.8/site-packages/slack/__init__.py)
>>> slack.
slack.ComponentNotRegisteredError(  slack.ParamterMissingError(         slack.inspect                       slack.partial(                      
slack.Container(                    slack.defaultdict(                  slack.invoke(                       
>>> slack.
slack.ComponentNotRegisteredError(  slack.ParamterMissingError(         slack.inspect                       slack.partial(                      
slack.Container(                    slack.defaultdict(                  slack.invoke(                       

Do you use anaconda or others for Python installation? If you go with a straight-forward way (e.g., pyenv + virtualenv or venv), you can smoothly install the package.

You don’t need to use pyenv if you prefer others but the following steps should be much easier.

$ brew install pyenv
$ pyenv install 3.7.0
$ pyenv local 3.7.0
$ python --version
Python 3.7.0
$ python -m venv env
$ source env/bin/activate
(env) $ pip install slackclient
(env) $ pip list
Package       Version
------------- -------
aiohttp       3.6.2  
async-timeout 3.0.1  
attrs         19.3.0 
chardet       3.0.4  
idna          2.9    
multidict     4.7.5  
pip           10.0.1 
setuptools    39.0.1 
slackclient   2.5.0  
yarl          1.4.2  
(env) $ python
Python 3.7.0 (default, May  3 2020, 12:54:06) 
[Clang 11.0.0 (clang-1100.0.33.8)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import slack
>>> from slack import WebClient
>>> slack.__file__
'/path-to-project/env/lib/python3.7/site-packages/slack/__init__.py'

Thanks for your reply, @seratch It work for me under virtual environment of python. Verify to close this issue.

1reaction
seratchcommented, May 3, 2020

At least having slack PyPI package prevents you from loading slack package after resolving the issue described here. So, please uninstall it anyways.

>>> import slack
>>> from slack import WebClient
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'WebClient' from 'slack' (/Users/ksera/.pyenv/versions/3.8.2/lib/python3.8/site-packages/slack/__init__.py)
>>> slack.
slack.ComponentNotRegisteredError(  slack.ParamterMissingError(         slack.inspect                       slack.partial(                      
slack.Container(                    slack.defaultdict(                  slack.invoke(                       
>>> slack.
slack.ComponentNotRegisteredError(  slack.ParamterMissingError(         slack.inspect                       slack.partial(                      
slack.Container(                    slack.defaultdict(                  slack.invoke(                       

Do you use anaconda or others for Python installation? If you go with a straight-forward way (e.g., pyenv + virtualenv or venv), you can smoothly install the package.

You don’t need to use pyenv if you prefer others but the following steps should be much easier.

$ brew install pyenv
$ pyenv install 3.7.0
$ pyenv local 3.7.0
$ python --version
Python 3.7.0
$ python -m venv env
$ source env/bin/activate
(env) $ pip install slackclient
(env) $ pip list
Package       Version
------------- -------
aiohttp       3.6.2  
async-timeout 3.0.1  
attrs         19.3.0 
chardet       3.0.4  
idna          2.9    
multidict     4.7.5  
pip           10.0.1 
setuptools    39.0.1 
slackclient   2.5.0  
yarl          1.4.2  
(env) $ python
Python 3.7.0 (default, May  3 2020, 12:54:06) 
[Clang 11.0.0 (clang-1100.0.33.8)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import slack
>>> from slack import WebClient
>>> slack.__file__
'/path-to-project/env/lib/python3.7/site-packages/slack/__init__.py'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python can't find installed module ('slackclient') - Stack Overflow
I am trying to build a slack bot for learning purpose but when I run the script get this error ModuleNotFoundError: No module...
Read more >
ModuleNotFoundError: No module named ... - RoseIndia.Net
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'slack' How to remove the ModuleNotFou.
Read more >
Python Slack SDK - PyPI
The Slack API Platform SDK for Python. ... This Development Kit is a module based wrapper that makes interaction with that API easier....
Read more >
FAQ — Python Slack SDK
If you encounter an error saying AttributeError: module 'slack' has no attribute 'WebClient' , run pip list .
Read more >
No module named 'slack' - Rasa Open Source
File anaconda lib path lib\site-packages\rasa\core\channels\slack.py, line 18, in from slack import webclient ModuleNotFoundError: No module ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found