Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Problem installing urlparse4 package
I'm attempting to use legacy code created earlier this year that contains the line:

from urlparse import urljoin
However, when I try to do
pip install urljoin
, I get the error message
Could not find a version that satisfies the requirement urljoin

I'm working on a Windows 10 machine. I believe that the code was developed on a Mac, so that might be one issue...

I determined that the urlparse module is renamed to urllib.parse in Python 3; accordingly, I tried
pip install urllib.parse
, but the same error message as above results.

Also, I did
pip search urlparse
and see that there are urlparse2, urlparse3, and urlparse4 packages available; I successfully installed urlparse2 and urlparse3, but the one I really seem to need, urlparse4, which is the replacement for the previous urlparse package (, gives the error message:

Command "python egg_info" failed with error code 1
I am trying this command from both my Anaconda prompt and from my Windows command prompt, both run as administrator.

I located this very useful thread:

Python pip install gives “Command ”python egg_info“ failed with error code 1”

and have worked through all of the seemingly relevant advice:

pip install ez_setup
pip install --upgrade setuptools
completed successfully, but do not solve the error above.

easy_install -U setuptools
results in an
access denied

I have also tried substituting pip3 instead of pip, but the pip3 command is not recognized. I have prefaced each command with "sudo", but this is not recognized as a command.

Any advice about additional options to resolve this error would be much appreciated. Thanks!
(Oct-06-2017, 04:53 PM)BobLoblaw Wrote: I determined that the urlparse module is renamed to urllib.parse in Python 3; accordingly, I tried
You don't need to install anything it's just a different import name for Python 3:
>>> from urllib.parse import urlparse
>>> from urllib.parse import urljoin
BobLoblaw likes this post
Thanks, snippsat -- that worked!

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Installing a python package using pip anthonymoss78 0 123 Jul-14-2020, 01:52 PM
Last Post: anthonymoss78
  Problem Installing rasterio gw1500se 1 286 Mar-24-2020, 06:28 PM
Last Post: gw1500se
  Problem installing library thunderspeed 2 426 Mar-22-2020, 11:04 PM
Last Post: thunderspeed
  Please help: problem installing/importing langdetect module in Jupyter Notebook ledgreve 3 1,470 Dec-30-2019, 08:17 AM
Last Post: LeanbridgeTech
  Installing a new package using pip in conda environment firebolt7 1 522 Nov-18-2019, 12:31 PM
Last Post: snippsat
  Problem installing instaloader ledgreve 21 2,738 Nov-18-2019, 11:28 AM
Last Post: ledgreve
  Problem with installing PyPDF2 Pavel_47 2 1,418 Nov-10-2019, 02:58 PM
Last Post: Pavel_47
  Problem with importing an installed package Reverend_Jim 4 1,132 Jun-14-2019, 10:20 PM
Last Post: Reverend_Jim
  Problem installing numpy and matplotlib achondrite 1 910 Jan-16-2019, 11:43 PM
Last Post: snippsat
  pip not installing any package on windows royhimo855 0 1,229 Dec-10-2018, 07:58 AM
Last Post: royhimo855

Forum Jump:

Users browsing this thread: 1 Guest(s)