Forums

error when install a module

I get this error when I install yahoo_fin using pip2.7 install --user yahoo_fin

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8xRisI/websockets/

Collecting yahoo_fin Using cached https://files.pythonhosted.org/packages/db/d9/841e18769ea2e9119c99fffb38139c90451554ef4eadd313c343dfd9bbf5/yahoo_fin-0.8.8.tar.gz Collecting requests_html (from yahoo_fin) Using cached https://files.pythonhosted.org/packages/86/76/27a8fd44f43d265af17e75be753b6ebf67c93b1d4dc7cf6eb6ea2d03a13c/requests-html-0.10.0.tar.gz Requirement already satisfied (use --upgrade to upgrade): feedparser in /usr/local/lib/python2.7/dist-packages (from yahoo_fin) Requirement already satisfied (use --upgrade to upgrade): requests in ./.local/lib/python2.7/site-packages (from yahoo_fin) Requirement already satisfied (use --upgrade to upgrade): pandas in ./.local/lib/python2.7/site-packages (from yahoo_fin) Requirement already satisfied (use --upgrade to upgrade): pyquery in /usr/local/lib/python2.7/dist-packages (from requests_html->yahoo_fin) Collecting fake-useragent (from requests_html->yahoo_fin) Using cached https://files.pythonhosted.org/packages/d1/79/af647635d6968e2deb57a208d309f6069d31cb138066d7e821e575112a80/fake-useragent-0.1.11.tar.gz Collecting parse (from requests_html->yahoo_fin) Using cached https://files.pythonhosted.org/packages/89/a1/82ce536be577ba09d4dcee45db58423a180873ad38a2d014d26ab7b7cb8a/parse-1.19.0.tar.gz Collecting bs4 (from requests_html->yahoo_fin) Using cached https://files.pythonhosted.org/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz Requirement already satisfied (use --upgrade to upgrade): w3lib in /usr/local/lib/python2.7/dist-packages (from requests_html->yahoo_fin) Collecting pyppeteer>=0.0.14 (from requests_html->yahoo_fin) Using cached https://files.pythonhosted.org/packages/07/67/a7eca24bf7620e11ba8be87a8c8eee5f3be0b2416aa942526b30d0348800/pyppeteer-0.2.5.tar.gz Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /usr/local/lib/python2.7/dist-packages (from pandas->yahoo_fin) Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.local/lib/python2.7/site-packages (from pandas->yahoo_fin) Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in ./.local/lib/python2.7/site-packages (from pandas->yahoo_fin) Requirement already satisfied (use --upgrade to upgrade): cssselect in /usr/local/lib/python2.7/dist-packages (from pyquery->requests_html->yahoo_fin) Requirement already satisfied (use --upgrade to upgrade): lxml>=2.1 in /usr/local/lib/python2.7/dist-packages (from pyquery->requests_html->yahoo_fin) Requirement already satisfied (use --upgrade to upgrade): beautifulsoup4 in /usr/local/lib/python2.7/dist-packages (from bs4->requests_html->yahoo_fin) Collecting appdirs<2.0.0,>=1.4.3 (from pyppeteer>=0.0.14->requests_html->yahoo_fin) Using cached https://files.pythonhosted.org/packages/3b/00/2344469e2084fb287c2e0b57b72910309874c3245463acd6cf5e3db69324/appdirs-1.4.4-py2.py3-none-any.whl Collecting pyee<9.0.0,>=8.1.0 (from pyppeteer>=0.0.14->requests_html->yahoo_fin) Using cached https://files.pythonhosted.org/packages/0d/0a/933b3931107e1da186963fd9bb9bceb9a613cff034cb0fb3b0c61003f357/pyee-8.1.0-py2.py3-none-any.whl Collecting tqdm<5.0.0,>=4.42.1 (from pyppeteer>=0.0.14->requests_html->yahoo_fin) Using cached https://files.pythonhosted.org/packages/42/d7/f357d98e9b50346bcb6095fe3ad205d8db3174eb5edb03edfe7c4099576d/tqdm-4.61.0-py2.py3-none-any.whl Requirement already satisfied (use --upgrade to upgrade): urllib3<2.0.0,>=1.25.8 in ./.local/lib/python2.7/site-packages (from pyppeteer>=0.0.14->requests_html->yahoo_fin) Collecting websockets<9.0,>=8.1 (from pyppeteer>=0.0.14->requests_html->yahoo_fin) Using cached https://files.pythonhosted.org/packages/e9/2b/cf738670bb96eb25cb2caf5294e38a9dc3891a6bcd8e3a51770dbc517c65/websockets-8.1.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-mu2tIS/websockets/setup.py", line 1, in <module> import pathlib ImportError: No module named pathlib

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mu2tIS/websockets/

The first line of the project description says "Yahoo_fin is a Python 3 package designed to scrape historical stock price data", so the problem is probably that you're installing a Python 3 package into Python 2.