Installations:
Windows 10, 64 bit.
Python 3.6.5
I am trying to execute pip install -r pyproj-1.9.6-cp36-cp36m-win_amd64.whl command.
However getting below error:
ERROR: Exception:
Traceback (most recent call last):
File "c:\users\sneka\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in _main
status = self.run(options, args)
File "c:\users\sneka\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\cli\req_command.py", line 185, in wrapper
return func(self, options, args)
File "c:\users\sneka\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\commands\install.py", line 302, in run
check_supported_wheels=not options.target_dir,
File "c:\users\sneka\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\cli\req_command.py", line 341, in get_requirements
finder=finder, options=options, session=session):
File "c:\users\sneka\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_file.py", line 151, in parse_requirements
for parsed_line in parser.parse(filename, constraint):
File "c:\users\sneka\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_file.py", line 330, in parse
for line in self._parse_and_recurse(filename, constraint):
File "c:\users\sneka\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_file.py", line 335, in _parse_and_recurse
for line in self._parse_file(filename, constraint):
File "c:\users\sneka\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_file.py", line 369, in _parse_file
filename, self._session, comes_from=self._comes_from
File "c:\users\sneka\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\req\req_file.py", line 574, in get_file_content
content = auto_decode(f.read())
File "c:\users\sneka\appdata\local\programs\python\python36\lib\site-packages\pip\_internal\utils\encoding.py", line 41, in auto_decode
locale.getpreferredencoding(False) or sys.getdefaultencoding(),
File "c:\users\sneka\appdata\local\programs\python\python36\lib\encodings\cp1252.py", line 15, in decode
return codecs.charmap_decode(input,errors,decoding_table)
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 118: character maps to <undefined>
I am new to python and not able to solve this error. Please help.
Remove -r. It should be pip install pyproj-1.9.6-cp36-cp36m-win_amd64.whl
Related
I am trying to pip install couchdb on my Linux Virtual Machine (Ubuntu 20.04) and I am getting the follow error.
cc#team5-vm1-2:~$ pip install couchdb
Defaulting to user installation because normal site-packages is not writeable
ERROR: Exception:
Traceback (most recent call last):
File "/home/cc/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
status = self.run(options, args)
File "/home/cc/.local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 203, in wrapper
return func(self, options, args)
File "/home/cc/.local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 266, in run
session = self.get_default_session(options)
File "/home/cc/.local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 74, in get_default_session
self._session = self.enter_context(self._build_session(options))
File "/home/cc/.local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 88, in _build_session
session = PipSession(
File "/home/cc/.local/lib/python3.8/site-packages/pip/_internal/network/session.py", line 289, in __init__
self.headers["User-Agent"] = user_agent()
File "/home/cc/.local/lib/python3.8/site-packages/pip/_internal/network/session.py", line 132, in user_agent
linux_distribution = distro.linux_distribution() # type: ignore
File "/home/cc/.local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 125, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File "/home/cc/.local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 680, in linux_distribution
self.name() if full_distribution_name else self.id(),
File "/home/cc/.local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 718, in name
name = self.os_release_attr('name') \
File "/home/cc/.local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 894, in os_release_attr
return self._os_release_info.get(attribute, '')
File "/home/cc/.local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 556, in __get__
ret = obj.__dict__[self._fname] = self._f(obj)
File "/home/cc/.local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 933, in _os_release_info
return self._parse_os_release_content(release_file)
File "/home/cc/.local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 964, in _parse_os_release_content
tokens = list(lexer)
File "/usr/lib/python3.8/shlex.py", line 300, in __next__
token = self.get_token()
File "/usr/lib/python3.8/shlex.py", line 109, in get_token
raw = self.read_token()
File "/usr/lib/python3.8/shlex.py", line 140, in read_token
nextchar = self.instream.read(1)
File "/usr/lib/python3.8/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x99 in position 0: invalid start byte
I've tried the results for locale and this is the returning results and it doesn't seem to solve my problem.
cc#team5-vm1-2:~$ locale
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
I solved the problem by uninstalling and purging python3 and pip, using autoremove, then reinstall python3 and pip.
So I was working on a automated whatsapp messenger and I tried to install the module known as "pywhatkit" but I am getting an error everytime.
The error trace is the following:
ERROR: Exception: Traceback (most recent call last): File
"c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\resolvers.py",
line 171, in _merge_into_criterion
crit = self.state.criteria[name] KeyError: 'pymsgbox'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\cli\base_command.py", line 189, in _main
status = self.run(options, args)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\cli\req_command.py", line 178, in wrapper
return func(self, options, args)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\commands\install.py", line 316, in run
requirement_set = resolver.resolve(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 121, in resolve
self._result = resolver.resolve(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 453, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 318, in resolve
name, crit = self._merge_into_criterion(r, parent=None)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 173, in _merge_into_criterion
crit = Criterion.from_requirement(self._p, requirement, parent)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 82, in from_requirement
if not cands:
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 124, in __bool__
return bool(self._sequence)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 143, in __bool__
return any(self)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 38, in _iter_built
candidate = func()
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 167, in _make_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 300, in __init__
super().__init__(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 144, in __init__
self.dist = self._prepare()
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 226, in _prepare
dist = self._prepare_distribution()
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 311, in _prepare_distribution
return self._factory.preparer.prepare_linked_requirement(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\prepare.py", line 457, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\prepare.py", line 500, in _prepare_linked_requirement
dist = _get_prepared_distribution(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\prepare.py", line 66, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\distributions\sdist.py", line 39, in prepare_distribution_metadata
self._setup_isolation(finder)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\distributions\sdist.py", line 66, in _setup_isolation
self.req.build_env = BuildEnvironment()
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\build_env.py", line 83, in __init__
fp.write(textwrap.dedent(
File "c:\users\पज\appdata\local\programs\python\python38\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-149: character maps to <undefined>
pip install pywhatkit
If this doesn't work use
pip install pipwin
And then
pipwin install pywhatkit
If it is installed and giving error try
pip install pywhatkit --upgrade
I had the same problem. I used a lot of tricks but finally got my solution. I didn't add my python scripts directory in the path variable. C:\Users\Computer\AppData\Roaming\Python\Python310\Scripts. When I added this path to the path variable. Then pywhatkit was running on my machine. Note: I had recently reset my computer and gave it windows 10 pro!
Hi Im trying to install pip on my pc - windows 8 in hebrew.
I installed python 2.7. I added python to my path.
I ran some random printing in python file and its work. so python is ok.
when i try to install get-pip.py I get this error:
C:\Users\yogi>python get-pip.py
Exception:
Traceback (most recent call last):
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\basecommand.py",
line 232, in main
status = self.run(options, args)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\commands\install.
py", line 339, in run
requirement_set.prepare_files(finder)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\req\req_set.py",
line 235, in prepare_files
req_to_install, self.upgrade)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\index.py", line 3
05, in find_requirement
page = self._get_page(main_index_url, req)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\index.py", line 7
83, in _get_page
return HTMLPage.get_page(link, req, session=self.session)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\index.py", line 8
72, in get_page
"Cache-Control": "max-age=600",
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
sessions.py", line 473, in get
return self.request('GET', url, **kwargs)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\download.py", lin
e 365, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
sessions.py", line 461, in request
resp = self.send(prep, **send_kwargs)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
sessions.py", line 610, in send
r.content
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
models.py", line 728, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes
()
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
models.py", line 653, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
packages\urllib3\response.py", line 256, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
packages\urllib3\response.py", line 186, in read
data = self._fp.read(amt)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\cachecont
rol\filewrapper.py", line 54, in read
self.__callback(self.__buf.getvalue())
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\cachecont
rol\controller.py", line 213, in cache_response
self.serializer.dumps(request, response, body=body),
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\download.py", lin
e 268, in set
return super(SafeFileCache, self).set(*args, **kwargs)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\cachecont
rol\caches\file_cache.py", line 83, in set
with FileLock(name) as lock:
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\lockfile\
mkdirlockfile.py", line 18, in __init__
LockBase.__init__(self, path, threaded, timeout)
File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\lockfile\
__init__.py", line 189, in __init__
hash(self.path)))
File "C:\Python27\lib\ntpath.py", line 84, in join
result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 0: ordinal
not in range(128)
any help would appreciated
Thought you may wanna try these since you are installing it in Hebrew.
1.) Open path "C:\Python27\Lib\" and search for python file "mimetypes.py".
2.) Open and Edit that file. Search for line "default_encoding = sys.getdefaultencoding()"
3.) And add these lines before the searched line in (step 2):
if sys.getdefaultencoding() != 'gbk':
reload(sys)
sys.setdefaultencoding('gbk')
The UnicodeDecode Error might be because you are using wrong version of get-pip.py.
All the strings in Python3 are unicode by default, but in Python2 it is not so.
If you are trying to use get-pip of Python3 with Python2, it might likely be the cause of your error.Try checking for/ obtaining the correct version! :)
I am trying to read a matlab file with SCIPY.IO library. And i am recieving the following error
Drives = sio.loadmat('Data/Drives.mat')
Traceback (most recent call last):
File "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Mic
rosoft\Python Tools for Visual Studio\2.0\visualstudio_py_util.py", line 76, in
exec_file
exec(code_obj, global_variables)
File "C:\Users\nasir\documents\visual studio 2013\Projects\EnergyInformatics\E
nergyInformatics\main.py", line 82, in <module>
main()
File "C:\Users\nasir\documents\visual studio 2013\Projects\EnergyInformatics\E
nergyInformatics\main.py", line 44, in main
simulation = SetupSimulation(server_sock=None,NUMBER_OF_PEVS=item[0],Grid_Fa
ctor=item[1],SOLAR_FACTOR=5,CHARGE_AT="HOME",ONE_PARKING_PERIOD=True,PARAM_FILEN
AME=None)
File "C:\Users\nasir\documents\visual studio 2013\Projects\EnergyInformatics\E
nergyInformatics\SetupSimulation.py", line 33, in __init__
self.GenerateVehicles()
File "C:\Users\nasir\documents\visual studio 2013\Projects\EnergyInformatics\E
nergyInformatics\SetupSimulation.py", line 99, in GenerateVehicles
drivingProfiles, consumptionProfiles = self.Create_Driving_Profiles(self.NUM
BER_OF_PEVS, TIMESTEPS_DRIVING, STEPSIZE, DAY_TYPE, SEASON)
File "C:\Users\nasir\documents\visual studio 2013\Projects\EnergyInformatics\E
nergyInformatics\SetupSimulation.py", line 130, in Create_Driving_Profiles
muenchenDrives = sio.loadmat('Data/muenchenDrives.mat')
File "C:\Python32\lib\site-packages\scipy\io\matlab\mio.py", line 175, in load
mat
matfile_dict = MR.get_variables(variable_names)
File "C:\Python32\lib\site-packages\scipy\io\matlab\mio5.py", line 292, in get
_variables
res = self.read_var_array(hdr, process)
File "C:\Python32\lib\site-packages\scipy\io\matlab\mio5.py", line 255, in rea
d_var_array
return self._matrix_reader.array_from_header(header, process)
File "mio5_utils.pyx", line 624, in scipy.io.matlab.mio5_utils.VarReader5.arra
y_from_header (scipy\io\matlab\mio5_utils.c:5401)
File "mio5_utils.pyx", line 671, in scipy.io.matlab.mio5_utils.VarReader5.arra
y_from_header (scipy\io\matlab\mio5_utils.c:5062)
File "mio5_utils.pyx", line 900, in scipy.io.matlab.mio5_utils.VarReader5.read
_struct (scipy\io\matlab\mio5_utils.c:7576)
File "mio5_utils.pyx", line 622, in scipy.io.matlab.mio5_utils.VarReader5.read
_mi_matrix (scipy\io\matlab\mio5_utils.c:4662)
File "mio5_utils.pyx", line 669, in scipy.io.matlab.mio5_utils.VarReader5.arra
y_from_header (scipy\io\matlab\mio5_utils.c:5040)
File "mio5_utils.pyx", line 822, in scipy.io.matlab.mio5_utils.VarReader5.read
_cells (scipy\io\matlab\mio5_utils.c:6748)
File "mio5_utils.pyx", line 622, in scipy.io.matlab.mio5_utils.VarReader5.read
_mi_matrix (scipy\io\matlab\mio5_utils.c:4662)
File "mio5_utils.pyx", line 665, in scipy.io.matlab.mio5_utils.VarReader5.arra
y_from_header (scipy\io\matlab\mio5_utils.c:4979)
File "mio5_utils.pyx", line 802, in scipy.io.matlab.mio5_utils.VarReader5.read
_char (scipy\io\matlab\mio5_utils.c:6450)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 44: invalid
start byte
I have tried the codecs library too but it did not work. any help or suggestion will be highly appreciated
Whenever I try to use pip I receive the following error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 720, in <module>
class Environment(object):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 723, in Environment
def __init__(self, search_path=None, platform=get_supported_platform(), python=PY_MAJOR):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 109, in get_supported_platform
plat = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), m.group(3))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 221, in _macosx_vers
version = platform.mac_ver()[0]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 804, in mac_ver
info = _mac_ver_xml()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 781, in _mac_ver_xml
pl = plistlib.readPlist(fn)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 78, in readPlist
rootObject = p.parse(pathOrFile)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 406, in parse
parser.ParseFile(fileobj)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 418, in handleEndElement
handler()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 452, in end_key
self.currentKey = self.getData()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 436, in getData
data = data.encode("ascii")
LookupError: no codec search functions registered: can't find encoding
trying to run sudo easy_install pip results in the same message. I have previously used pip and received this when trying to install a virtualenv for a project. I can't think of any recent updates or system changes that would have caused this. Has anyone encountered this error message before?