3

I tried following command

pip3 install geograpy

A warning came

WARNING! You are attempting to install newspaper's python2 repository on python3. PLEASE RUN `$ pip3 install newspaper3k` for python3 or `$ pip install newspaper` for python2

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ulhaaak8/newspaper/

After I tried

pip3 install newspaper3k

It successfully installed

after i tried previous command again. but the same error came again.

2 Answers2

2

geograpy's setup.py declares newspaper as a dependency. This is a bug in setup.py; for Python 3 the dependency must be newspaper3k. Perhaps there are other problems with Python 3.

There is a pull request that fixes installation with Python 3.

phd
  • 82,685
  • 13
  • 120
  • 165
  • I couldn't find the setup.py file in venv/lib/site-packages/geograpy. Where can I find that file? – Peshala Liyanage Feb 17 '19 at 18:17
  • 1
    `site-packages/` contains only [importable package](https://github.com/ushahidi/geograpy/tree/6d99e787a9767bdc67fd6bf6face8df7bf3b95e9/geograpy) but not development files of which `setup.py` is just one. Clone the directory, apply the pull request and run `pip install .`. Or [install directlry from the pull request](https://stackoverflow.com/a/50095199/7976758). – phd Feb 17 '19 at 19:04
0

I changed the default python version(2.7) to 3.6 in my Ubuntu system. After that the problem solved. Go to this link