Python Forum
Problem installing urlparse4 package - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Problem installing urlparse4 package (/thread-5480.html)



Problem installing urlparse4 package - BobLoblaw - Oct-06-2017

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/35991403/python-pip-install-gives-command-python-setup-py-egg-info-failed-with-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!


RE: Problem installing urlparse4 package - snippsat - Oct-06-2017

(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
>>>



RE: Problem installing urlparse4 package - BobLoblaw - Oct-06-2017

Thanks, snippsat -- that worked!