1

I am trying to install PyInstaller and when I use pip install PyInstaller it doesn't work.

I also tried to download the ZIP and install the requirements with pip install -r requirements.txt but that didn't work either...

Collecting pyinstaller Using cached https://files.pythonhosted.org/packages/03/32/0e0de593f129bf1d1e77eed562496d154ef4460fd5cecfd78612ef39a0cc/PyInstaller-3.4.tar.gz ERROR: Exception: Traceback (most recent call last): File "c:\users\Rom\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\cli\base_command.py", line 178, in main status = self.run(options, args) File "c:\users\Rom\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\commands\install.py", line 352, in run resolver.resolve(requirement_set) File "c:\users\Rom\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\resolve.py", line 131, in resolve self._resolve_one(requirement_set, req) File "c:\users\Rom\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\resolve.py", line 294, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "c:\users\Rom\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\resolve.py", line 242, in _get_abstract_dist_for self.require_hashes File "c:\users\Rom\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\prepare.py", line 362, in prepare_linked_requirement abstract_dist.prep_for_dist(finder, self.build_isolation) File "c:\users\Rom\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\prepare.py", line 144, in prep_for_dist self.req.build_env = BuildEnvironment() File "c:\users\Rom\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\build_env.py", line 105, in __init__ ).format(system_sites=system_sites, lib_dirs=self._lib_dirs)) File "c:\users\Rom\appdata\local\programs\python\python37\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 148-150: character maps to <undefined> 

I expected it to work even though it had one exception because when I try again it says that all of the requirements are satisfied :P

I am sorry it's so messy, I just really don't know what to do :'(

1
  • os version? how did you install? Commented Jun 4, 2019 at 7:28

3 Answers 3

2

Since you're on Windows, try installing the PyInstaller wheel from Christoph Gohlke's website: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyinstaller

Unfortunately he has disabled linking directly to wheels on his website, so you have to physically go there and download the wheel yourself. You'll see a link to PyInstaller‑3.4‑py2.py3‑none‑any.whl when you visit the above link. Click on the link to download the wheel directly, then in the Command Prompt, navigate to where you downloaded it and do:

pip install PyInstaller‑3.4‑py2.py3‑none‑any.whl 

This should get it installed!


Edit

It seems that the trouble you're facing once you install the package is a well-known one in Windows: https://github.com/pyinstaller/pyinstaller/issues/310

The solution is to insert this code at the beginning before you do anything:

import sys import codecs sys.stdout = codecs.getwriter('utf8')(sys.stdout) 

It has something to do with the source code of PyInstaller where it's in an encoding scheme that is different on your machine from how it was originally developed.

Sign up to request clarification or add additional context in comments.

9 Comments

now I have another problem. When I use the pyinstaller it gives me an exception: UnicodeEncodeError: 'charmap' codec can't encode characters in position 122-124: character maps to <undefined>
@rom_totach Please see my edit. Apparently this is an issue with Windows.
that still didn't work... Do I need to add this part in every .py file?
I am using this in one file but this file uses a lot of methods in other files
And I have a lot of precompiled python files, I am using a bot library, so... probably something in the precompiled files
|
0

pipwin installs unofficial python package binaries for windows provided by Christoph Gohlke here

pip install pipwin pipwin install pyinstaller 

3 Comments

Nice - didn't know that this was around. Finally I can stop downloading the wheels manually. Thanks!
well, it downloaded a lot of things and then it failed again.
in my project's folder
0

To install PyInstaller:

  1. Go to your command prompt (Start -> Run -> cmd)
  2. type the following command cd c:\python27\scripts press enter, this should be where your pip.exe file is located.
  3. Once you are in this directory type pip install pyinstaller press enter

Message should read Successfully installed pyinstaller.

https://pyinstaller.readthedocs.io/en/v3.3.1/installation.html

1 Comment

It didn't work. It knows what pip is but after downloaded the package it fails to install

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.