Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Portable python - can't install pip

I'm trying to get pip on my USB drive. Following the instructions on this web sit, I downloaded get-pip.py and run python get-pip.py (python is in the environment path). Unfortunately the script through an error. I have uploaded the log file to here. The error itself is:

Exception:
Traceback (most recent call last):
  File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2251, in parsed_version
    return self._parsed_version
  File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2344, in __getattr__
    raise AttributeError(attr)
AttributeError: _parsed_version

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2259, in version
    return self._version
  File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2344, in __getattr__
    raise AttributeError(attr)
AttributeError: _version

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\commands\install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\req.py", line 1420, in install
    if existing_distribute in distribute_requirement:
  File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2643, in __contains__
    if self.index: item = item.parsed_version  # only get if we need it
  File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2253, in parsed_version
    self._parsed_version = pv = parse_version(self.version)
  File "c:\users\elyashic\appdata\local\temp\tmprkcrtx\pip.zip\pip\_vendor\pkg_resources.py", line 2267, in version
    "Missing 'Version:' header and/or %s file" % self.PKG_INFO, self
ValueError: ("Missing 'Version:' header and/or PKG-INFO file", distribute [unknown version] (i:\portableapps\portable python 3.2.5.1\app\scripts))

Can any one explain to me what I did wrong?

I'm using portable python 3.2.5.1, and it was fresh from the installation until I tried installing pip.

like image 395
elyashiv Avatar asked May 27 '14 11:05

elyashiv


People also ask

Why can't I install pip in Python?

Navigate to the directory, where you downloaded get-pip.py (in command prompt using the command cd ). Run the command python get-pip.py from a command prompt with admin privileges (possibly not needed, but just to make sure). This should be all. Close your command prompt, open it again and run pip --version to test it.

How do I manually install pip in Python?

Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process.

How do I install pip if Python is installed?

Ensure you can run pip from the command line Run python get-pip.py . 2 This will install or upgrade pip. Additionally, it will install setuptools and wheel if they're not installed already. Be cautious if you're using a Python install that's managed by your operating system or another package manager.

Does Python 3.10 support pip?

The current version of pip works on: Windows, Linux and MacOS. CPython 3.7, 3.8, 3.9, 3.10 and latest PyPy3.


1 Answers

I ran into the same issue with the same version of Portable Python 3.2.5.1. The easy_install.py script located in App\Scripts\easy_install.py was broken for me too, due to some syntax error inside the script.

After many dead ends, I found https://winpython.github.io/. It picks up where Portable Python left off.

like image 115
AaronDanielson Avatar answered Oct 05 '22 11:10

AaronDanielson