Anaconda - 已将软件包安装到基础虚拟环境,但无法在 Spyder、pycharm 或 Jupiter 笔记本中运行
我打开了一个新终端并运行
conda activate base
pip install sailthru-client
然后我打开了 Spyder 尝试导入:
from sailthru.sailthru_client import SailthruClient
但是看到:
File "/Users/me/sailthru.py", line 9, in <module>
from sailthru.sailthru_client import SailthruClient
ModuleNotFoundError: No module named 'sailthru.sailthru_client'; 'sailthru' is not a package
在我的终端中如果我运行 echo $PATH 我看到:
/opt/anaconda3/bin:/Applications/SnowSQL.app/Contents/MacOS:/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin :/库/Apple/usr/bin
以及在我的终端中,如果我运行:
python3
from sailthru.sailthru_client import SailthruClient
我看到:
回溯(最近一次调用):文件“”,第 1 行,位于 文件“/Users/me/sailthru.py”,第 3 行,位于 from sailthru.sailthru_client import SailthruClient ModuleNotFoundError:没有名为“sailthru.sailthru_client”的模块; 'sailthru' 不是一个包
I've opened a new terminal and ran
conda activate base
pip install sailthru-client
Then I opened Spyder tried importing:
from sailthru.sailthru_client import SailthruClient
but see:
File "/Users/me/sailthru.py", line 9, in <module>
from sailthru.sailthru_client import SailthruClient
ModuleNotFoundError: No module named 'sailthru.sailthru_client'; 'sailthru' is not a package
In my terminal if I run echo $PATH I see:
/opt/anaconda3/bin:/Applications/SnowSQL.app/Contents/MacOS:/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
and also in my terminal if I run:
python3
from sailthru.sailthru_client import SailthruClient
I see:
Traceback (most recent call last): File "", line 1, in
File "/Users/me/sailthru.py", line 3, in
from sailthru.sailthru_client import SailthruClient ModuleNotFoundError: No module named 'sailthru.sailthru_client';
'sailthru' is not a package
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
文件“/Users/me/sailthru.py”
<- 您已通过创建同名的 python 脚本来隐藏模块sailthru
。重命名并重试File "/Users/me/sailthru.py"
<- you have shadowed the modulesailthru
by creating a python script with the same name. Rename that and try again