Python can't find installed module slackclient on MacOs. Any suggestions?

大城市里の小女人 提交于 2020-01-16 09:19:29

问题


I'm developing a slackbot. After importing slackclient, I got ModuleNotFoundError: No module named 'slackclient'.

I tried all the options and followed suggestions showed in the post here- Python can't find installed module ('slackclient'). By those suggestions, I installed slack but got the following error while importing WebClient.

>>> from slack import WebClient 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'WebClient' from 'slack' (<path_to _venv>/.venv/lib/python3.7/site-packages/slack/__init__.py)

I checked the slack version that seems like ok

slack         0.0.2  

Any suggestions what could I be doing wrong?


回答1:


The current version of slackclient for Python3 is 2.1.0.

To upgrade your environment run:

$ pip3 install slackclient --upgrade

You find the latest slackclient here.




回答2:


Using slackclient version 2

$ pip install slackclient --upgrade
$ pip freeze

slackclient==2.1.0

from slack import WebClient

OR, Using slackclient version 1

$ pip install slackclient==1.3.1

from slackclient import SlackClient



来源:https://stackoverflow.com/questions/57614585/python-cant-find-installed-module-slackclient-on-macos-any-suggestions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!