Today's python error: ModuleNotFoundError: No module named'bs4'

Program change (2) Python3: URL as command line argument (wikipedia) https://qiita.com/kaizen_nagoya/items/fc095b0c580a35001ea7

Work is being carried out with docker.

docker (89) python2, python3 with docker https://qiita.com/kaizen_nagoya/items/ecbe11a4d743357134d5

docker/ubuntu


# pip install bs4
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting bs4
  Downloading https://files.pythonhosted.org/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz
Collecting beautifulsoup4
  Downloading https://files.pythonhosted.org/packages/c5/48/c88b0b390ae1f785942fc83413feb1268a1eb696f343d4d55db735b9bb39/beautifulsoup4-4.8.2-py2-none-any.whl (106kB)
     |################################| 112kB 1.7MB/s 
Collecting soupsieve>=1.2
  Downloading https://files.pythonhosted.org/packages/81/94/03c0f04471fc245d08d0a99f7946ac228ca98da4fa75796c507f61e688c2/soupsieve-1.9.5-py2.py3-none-any.whl
Collecting backports.functools-lru-cache; python_version < "3"
  Downloading https://files.pythonhosted.org/packages/da/d1/080d2bb13773803648281a49e3918f65b31b7beebf009887a529357fd44a/backports.functools_lru_cache-1.6.1-py2.py3-none-any.whl
Building wheels for collected packages: bs4
  Building wheel for bs4 (setup.py) ... done
  Created wheel for bs4: filename=bs4-0.0.1-cp27-none-any.whl size=1273 sha256=79b8b3765197c5d2662611ba7f1199b00147c4741c41f4dc9cdc82d0f08f0609
  Stored in directory: /root/.cache/pip/wheels/a0/b0/b2/4f80b9456b87abedbc0bf2d52235414c3467d8889be38dd472
Successfully built bs4
Installing collected packages: backports.functools-lru-cache, soupsieve, beautifulsoup4, bs4
Successfully installed backports.functools-lru-cache-1.6.1 beautifulsoup4-4.8.2 bs4-0.0.1 soupsieve-1.9.5

# pip3 install bs4
Collecting bs4
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz
Collecting beautifulsoup4 (from bs4)
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/cb/a1/c698cf319e9cfed6b17376281bd0efc6bfc8465698f54170ef60a485ab5d/beautifulsoup4-4.8.2-py3-none-any.whl (106kB)
    100% |################################| 112kB 2.4MB/s 
Collecting soupsieve>=1.2 (from beautifulsoup4->bs4)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/81/94/03c0f04471fc245d08d0a99f7946ac228ca98da4fa75796c507f61e688c2/soupsieve-1.9.5-py2.py3-none-any.whl
Building wheels for collected packages: bs4
  Running setup.py bdist_wheel for bs4 ... done
  Stored in directory: /root/.cache/pip/wheels/a0/b0/b2/4f80b9456b87abedbc0bf2d52235414c3467d8889be38dd472
Successfully built bs4
Installing collected packages: soupsieve, beautifulsoup4, bs4
Successfully installed beautifulsoup4-4.8.2 bs4-0.0.1 soupsieve-1.9.5

# python2.7 wia.py
Traceback (most recent call last):
  File "wia.py", line 9, in <module>
    from urllib.request import urlopen
ImportError: No module named request

# python3.8 wib.py
Traceback (most recent call last):
  File "wib.py", line 8, in <module>
    from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'

# pip install urllib
ERROR: Could not find a version that satisfies the requirement urllib (from versions: none)
ERROR: No matching distribution found for urllib

# pip3 install urllib
Collecting urllib
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
    page = self._get_page(location)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 795, in get_page
    resp.raise_for_status()
  File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/urllib/

URLlib error

Install urllib with pip3 http://rongonxp.hatenablog.jp/entry/2018/02/01/000816

# pip3 install urllib3
Collecting urllib3
  Downloading https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl (125kB)
    100% |################################| 133kB 1.7MB/s 
Installing collected packages: urllib3
Successfully installed urllib3-1.25.7
# python3 wib.py
Traceback (most recent call last):
  File "wib.py", line 15, in <module>
    url = "https://ja.wikipedia.org/wiki/" + urllib.parse.quote(args[1])
IndexError: list index out of range

Document history

ver. 0.01 First draft 20191230 Afternoon ver. 0.02 urllib3 Addendum 20191230 Night

Recommended Posts

Today's python error: ModuleNotFoundError: No module named'bs4'
Today's python error: ModuleNotFoundError: No module named
Today's python error: ModuleNotFoundError: No module named
Today's python error: ModuleNotFoundError: No module named'requests'
Python error: ModuleNotFoundError: No module named'flask'
[Python] ModuleNotFoundError: No module named'urlparse'
ModuleNotFoundError: No module named'_bz2' error in pyenv Python
ModuleNotFoundError in Python: No module named story
Import Error in Python3: No module named'xxxxx'
ModuleNotFoundError: No module named'py4j'
Today's python error: killed
ModuleNotFoundError: No module named'flask_sqlalchemy'
Import cv2 ModuleNotFoundError: No module named'cv2' in python3
Today's python error: SyntaxError Non-ASCII character
Today's python error: image is blank
ModuleNotFoundError in poetry: No module named'setuptools'
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
Error when installing opencv-python on jetson nano (ModuleNotFoundError: No module named'skbuild')
Suddenly with Python PyInstaller No module named pyinstaller
ModuleNotFoundError: No module named'***' when running Flask
I get a Python No module named'encodings' error with the aws command
Error when installing a module with Python pip
Solution for "Import Error: No module named requests"
Today's python error: UnicodeEncodeError:'ascii' codec can't encode characters
Python module import
python> import seiral> ImportError: No module named serial
Python today's dog
Attempting to install opencv-python3 on jetson nano but error (ModuleNotFoundError: No module named'skbuild')
Today's python error: UnicodeEncodeError:'utf-8' codec can't encode characters
Python collections module
The problem that scikit-learn gives the error No module named'_bz2'
ModuleNotFoundError: No module What to do if you get'tensorflow.contrib'
Today's python error: HTTPError: 404 Client Error: Not Found for url:
Today's python error: invalid keyword argument for this function
Python module (Python learning memo ④)
Create a Python module
Python Not Implemented Error
python original module import
I got "ModuleNotFoundError: No module named'azure'" when running a program using Azure SDK for Python
Python error list (Japanese)
A story about a Python beginner who was about to be crushed by ModuleNotFoundError: No module named'tweepy'
What to do if you get Swagger-codegen in python and Import Error: No module named
[Python] for statement error
A story about a python beginner stuck with No module named'http.server'