Python - Importing pandas in console works but not

2019-09-11 23:52发布

I've been working with anaconda3/python3.5 and pandas for over a year and all of sudden when I run my script outside the console, I get a import error for pandas particularly the dependency email.parser. I get No module named 'email.parser';'email' is not a package. However importing in the console works fine. I'm not running any other environment

1条回答
我只想做你的唯一
2楼-- · 2019-09-12 00:44

I also had the same problem today. You're missing a specific path. Found that if you start your python interpreter and do import os, you can do os.environ. You'll notice that there are several paths set in the PATH variable. Copy/paste the entire PATH line into your script. That worked for me. Also, remember to remove string single quotes (e.g., ').

查看更多
登录 后发表回答