Python Forum
Problem installing urlparse4 package
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem installing urlparse4 package
#1
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!
Reply
#2
(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
>>>
Reply
#3
Thanks, snippsat -- that worked!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Photo Problem installing turtle MasterJediKnight7 17 24,300 Mar-18-2024, 10:22 AM
Last Post: bmohamadyar313
  problem install somewhere package akbarza 1 429 Dec-27-2023, 01:25 PM
Last Post: Gribouillis
  imdby package problem lunacy90 8 1,034 Sep-04-2023, 07:13 PM
Last Post: deanhystad
  [WORKED AROUND] Problem installing elitech-datareader, 'cannot import build_py_2to3' NeilUK 4 1,561 Jul-09-2023, 10:01 AM
Last Post: NeilUK
  Is it possible to see dependencies before installing a package? quazirfan 4 1,024 Dec-06-2022, 02:50 PM
Last Post: snippsat
  Unable to import sklearn after installing any package ilango 0 1,160 Oct-25-2021, 07:03 AM
Last Post: ilango
  Problem: Restart kernel onPydev console when trying to install a python package poppy2020 1 7,558 Nov-25-2020, 06:13 PM
Last Post: Larz60+
  Installing a python package using pip anthonymoss78 0 1,774 Jul-14-2020, 01:52 PM
Last Post: anthonymoss78
  Problem Installing rasterio gw1500se 1 2,166 Mar-24-2020, 06:28 PM
Last Post: gw1500se
  Problem installing library thunderspeed 2 2,278 Mar-22-2020, 11:04 PM
Last Post: thunderspeed

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020