0

i've run into some problems while trying to install pip on win10, I can't understand from where it's coming from, here's what the error looks like:

I run the command python get-pip.py --prefix=/usr/local/

And the cmd responded with an error:

Collecting pip
Using cached https://files.pythonhosted.org/packages/4a/08/6ca123073af4ebc4c5488a5bc8a010ac57aa39ce4d3c8a931ad504de4185/pip-19.3-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.3
Uninstalling pip-19.3:
Successfully uninstalled pip-19.3
Rolling back uninstall of pip
Moving to c:\python27\lib\site-packages\pip-19.3.dist-info\
from c:\python27\lib\site-packages\~ip-19.3.dist-info
Moving to c:\python27\lib\site-packages\pip\
from c:\python27\lib\site-packages\~ip
Moving to c:\python27\scripts\pip.exe
from c:\users\rpupi\appdata\local\temp\pip-uninstall-0vhfjn\pip.exe
Moving to c:\python27\scripts\pip2.7.exe
from c:\users\rpupi\appdata\local\temp\pip-uninstall-0vhfjn\pip2.7.exe
Moving to c:\python27\scripts\pip2.exe
from c:\users\rpupi\appdata\local\temp\pip-uninstall-0vhfjn\pip2.exe
ERROR: Exception:
Traceback (most recent call last):
File "c:\users\rpupi\appdata\local\temp\tmp72f5up\pip.zip\pip_internal\cli\base_command.py", line 188, in main status = self.run(options, args)
File "c:\users\rpupi\appdata\local\temp\tmp72f5up\pip.zip\pip_internal\commands\install.py", line 407, in run use_user_site=options.use_user_site,
File "c:\users\rpupi\appdata\local\temp\tmp72f5up\pip.zip\pip_internal\req__init__.py", line 58, in install_given_reqs
**kwargs
File "c:\users\rpupi\appdata\local\temp\tmp72f5up\pip.zip\pip_internal\req\req_install.py", line 928, in install use_user_site=use_user_site, pycompile=pycompile,
File "c:\users\rpupi\appdata\local\temp\tmp72f5up\pip.zip\pip_internal\req\req_install.py", line 461, in move_wheel_files warn_script_location=warn_script_location,
File "c:\users\rpupi\appdata\local\temp\tmp72f5up\pip.zip\pip_internal\wheel.py", line 326, in move_wheel_files prefix=prefix,
File "c:\users\rpupi\appdata\local\temp\tmp72f5up\pip.zip\pip_internal\locations.py", line 111, in distutils_scheme i.finalize_options()
File "C:\Python27\lib\site-packages\setuptools\command\install.py", line 38, in finalize_options orig.install.finalize_options(self)
File "C:\Python27\lib\distutils\command\install.py", line 353, in finalize_options 'userbase', 'usersite')
File "C:\Python27\lib\distutils\command\install.py", line 504, in convert_paths setattr(self, attr, convert_path(getattr(self, attr)))
File "C:\Python27\lib\distutils\util.py", line 124, in convert_path raise ValueError, "path '%s' cannot be absolute" % pathname ValueError: path '/usr/local//Lib/site-packages' cannot be absolute

Thanks if you know how to fix this. ANd feel free to ask anything you need to know.

1 Answer 1

0

Unfortunately, raise ValueError, "path '%s' cannot be absolute" % pathname is relatively generic as far as I am aware. You may wish to try python get-pip.py --prefix=/usr/local but that is just a guess.

However, you question raises more in my mind:

  • pip is installed with Python in most cases, so why are you even running python get-pip.py?

  • How did you install Python? C:\Python27 is usually associated with vanilla Python from Python.org in my experience. Did you get from Python there, from the Windows store or somewhere else (e.g. via Anaconda)?

  • Why are you adding --prefix=/usr/local? /usr/local is a Linux directory and only makes (possible) sense if you are running under the Windows Subsystem for Linux (WSL). Is that what you are using?

1
  • Just hit the same bug in a MinGW cross-compile prefix on Linux. Removing --prefix did the trick. May 11, 2023 at 11:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .