所以我试着按照这里的答案但没有运气: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)
我哪里错了?
答案 0 :(得分:0)
我必须将.py文件移到/home/ec2-user/environment/vpy36/lib/python3.6/dist-packages