개발모음집

Traceback (most recent call last): from bs4 import BeautifulSoup ModuleNotFoundError: No module named 'bs4' 본문

TheRestDevelop

Traceback (most recent call last): from bs4 import BeautifulSoup ModuleNotFoundError: No module named 'bs4'

void 2018. 6. 22. 09:00

1. pip로 패키지를 설치하려고 하니 pip 업그레이드하라는 경고가 나옴

You are using pip version 8.1.1, however version 10.0.1 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.


1-1 pip install --upgrade pip 입력해서 업그레이드함


2. 에러 발생

pip로 다시 패키지 설치하려고 하니

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
ImportError: cannot import name main

위와 같은 에러 발생



3. 해결법

1- Uninstall the pip update from python.
2- Uninstall pip package from your Ubuntu.
3- Check that pip binary is not longer in your system.

python -m pip uninstall pip
apt remove python-pip
whereis pip

4- Download and install pip. (credits for VanDragt.com)

wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py
sudo python3 /tmp/get-pip.py
pip install --user pipenv
pip3 install --user pipenv
echo "PATH=$HOME/.local/bin:$PATH" >> ~/.profile
source ~/.profile
whereis pip

출처 : stackoverflow





'TheRestDevelop' 카테고리의 다른 글

NGINX RTMP SOURCE INSTALL  (0) 2018.06.28
.txt를 wordcloud파일로 저장하기  (0) 2018.06.26
SendMessage Damage has no receiver!  (0) 2018.06.21
블록체인에 대한 조사  (0) 2018.06.18
Unity에서 php에 Request하는 코드  (0) 2018.06.15