Python Forum

Full Version: Problem installing urlparse4 package
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
Error:
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 (https://pypi.python.org/pypi/urlparse4/0.1.3), gives the error message:

Error:
Command "python setup.py 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 setup.py egg_info“ failed with error code 1”
https://stackoverflow.com/questions/3599...th-error-c

and have worked through all of the seemingly relevant advice:

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

easy_install -U setuptools
results in an
Error:
access denied
error.

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:
urllib.parse.urlparse()
>>> from urllib.parse import urlparse
>>>
>>> from urllib.parse import urljoin
>>>
Thanks, snippsat -- that worked!