简体   繁体   English

使用 venv 时出现 ModuleNotFoundError

[英]ModuleNotFoundError when using venv

I have just installed Python 3.8 on a Mac Catalina machine.我刚刚在 Mac Catalina 机器上安装了 Python 3.8。
I have created a new virtual env using PyCharm and installed the slackclient package using PyCharm's preferences.我使用 PyCharm 创建了一个新的虚拟环境,并使用 PyCharm 的首选项安装了slackclient package。
However, whichever way I try to run the app, I get the ModuleNotFoundError: No module named 'slackclient' error.但是,无论我尝试以哪种方式运行应用程序,都会收到ModuleNotFoundError: No module named 'slackclient'错误。 I have verified that it is installed in the OS terminal (zsh):我已验证它已安装在 OS 终端 (zsh) 中:

(venv) *** 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           20.0.2 
setuptools    46.1.3 
slackclient   2.5.0  
yarl          1.4.2  
(venv) *** python studiobot.py 
Traceback (most recent call last):
  File "studiobot.py", line 4, in <module>
    from slackclient import SlackClient
ModuleNotFoundError: No module named 'slackclient'

What am I doing wrong?我究竟做错了什么?
Thanks in advance!提前致谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM