无法从AWS Cloud9上的bs4导入BeautifulSoup

时间:2018-04-25 13:46:12

标签: python python-3.x amazon-web-services beautifulsoup cloud9-ide

所以我试着按照这里的答案但没有运气:https://forums.aws.amazon.com/thread.jspa?messageID=822214&tstart=0

我的python文件中只有from bs4 import BeautifulSoup的行返回ImportError: No module named bs4

我已经创建了我的virtualenv并激活了它,终端在每行的开头显示(vpy36)

python --version返回Python 3.6.2

python -m pip install bs4返回Requirement already satisfied: bs4 in /home/ec2-user/environment/vpy36/lib/python3.6/dist-packages (0.0.1)

Requirement already satisfied: beautifulsoup4 in /home/ec2-user/environment/vpy36/lib/python3.6/dist-packages (from bs4) (4.6.0)

我哪里错了?

1 个答案:

答案 0 :(得分:0)

我必须将.py文件移到/home/ec2-user/environment/vpy36/lib/python3.6/dist-packages