I heard pytorch also can use tensorboard.
after installing tensorboard I tried to open tensorboard in my Anaconda Prompt.
I found this, but I don't know how to solve this problem. and what is this problem
File "D:\anaconda\lib\site-packages\tensorboard\program.py", line 507, in server_bind
super(WerkzeugServer, self).server_bind()
File "D:\anaconda\lib\http\server.py", line 139, in server_bind
self.server_name = socket.getfqdn(host)
File "D:\anaconda\lib\socket.py", line 676, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 0: invalid start byte
Related
By running jupyter-console any press of Enter button show this error:
In [1]: /home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/jupyter_console/ptshell.py:852: RuntimeWarning: coroutine 'ZMQSocketChannel.msg_ready' was never awaited
while self.client.iopub_channel.msg_ready():
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Unhandled exception in event loop:
File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/input/vt100.py", line 168, in callback_wrapper
callback()
File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/application/application.py", line 691, in read_from_input
self.key_processor.process_keys()
File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_processor.py", line 274, in process_keys
self._process_coroutine.send(key_press)
File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_processor.py", line 186, in _process
self._call_handler(matches[-1], key_sequence=buffer[:])
File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_processor.py", line 329, in _call_handler
handler.call(event)
File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prompt_toolkit/key_binding/key_bindings.py", line 102, in call
result = self.handler(event)
File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/jupyter_console/ptshell.py", line 475, in _
self.handle_iopub()
File "/home/player1/.pyenv/versions/3.7.9/lib/python3.7/site-packages/jupyter_console/ptshell.py", line 854, in handle_iopub
msg_type = sub_msg['header']['msg_type']
Exception 'coroutine' object is not subscriptable
Press ENTER to continue...
I have tried different computers with different Linux distributions (Ubuntu, Mint, Manjaro KDE, Manjaro XFCE).
I tried different python versions (>3.6), different ipython verions and even with Docker.
Interesting that jupyter-qtconsole ,jupyter-notebook and ipython are working fine.
All answers I searched were about ipython or jupyter-notebook, but I need jupyter-console.
pip install jupyter-client==6.1.12
The answer is here: https://github.com/jupyter/jupyter_console/issues/241
I am having issues running this code on my machine, but it works fine on my schools linux machines.
The error i am getting is:
Traceback (most recent call last):
File "wireshark_02.py", line 74, in <module>
main()
File "wireshark_02.py", line 43, in main
input_data = dpkt.pcap.Reader(open(file_name,'r'))
File "C:\Users\Slava\AppData\Local\Programs\Python\Python36-32\lib\site-packages\dpkt\pcap.py", line 244, in __init__
buf = self.__f.read(FileHdr.__hdr_len__)
File "C:\Users\Slava\AppData\Local\Programs\Python\Python36-
32\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position
125: character maps to <undefined>
I've installed dpkt running pip install dpkt.
Is there anything i can do to make this work on my machine or do i need to use my schools computers?
open(file_name, 'rb')
worked for me!
I get the following errors while running the print_control_identifiers()
`>>> app['TRACE\u2122 3D Plus'].print_control_identifiers()
Control Identifiers:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\irgfff\AppData\Local\Programs\Python\Python35-32\lib\site- packa
ges\pywinauto\application.py", line 636, in print_control_identifiers
print_identifiers([this_ctrl, ])
File "C:\Users\irgfff\AppData\Local\Programs\Python\Python35-32\lib\site- packa
ges\pywinauto\application.py", line 630, in print_identifiers
print(output)
File "C:\Users\irgfff\AppData\Local\Programs\Python\Python35-32 \lib\encodings\
cp437.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2122' in position
17: character maps to <undefined>
>>>`
My configuration is
`C:\Users\irgfff>pip freeze
comtypes==1.1.3
pypiwin32==219
pywinauto==0.6.2
six==1.10.0`
First I thought it's a pywinauto issue, but still not sure 100%...
Try to insert the following comment at the beginning of your script (at the very first line, it's important):
# encoding: utf-16
# the rest of the script
Anyway please tell software engineers in your company that this symbol is not good for testability and automation. :)
So it took me a while before I pinned the cause of this one but still am at loss off how it is possible. I have recently switched to python3 and I got this huge error when trying to import matplotlib:
Traceback (most recent call last):
File "C:/Users/y2kbugger/Desktop/test.py", line 6, in <module>
File "C:\Anaconda2\envs\mypackage\lib\site-packages\matplotlib\__init__.py", lin
e 124, in <module>
from matplotlib.rcsetup import (defaultParams,
File "C:\Anaconda2\envs\mypackage\lib\site-packages\matplotlib\rcsetup.py", line
30, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "C:\Anaconda2\envs\mypackage\lib\site-packages\matplotlib\fontconfig_patter
n.py", line 25, in <module>
from pyparsing import Literal, ZeroOrMore, \
File "C:\Anaconda2\envs\mypackage\lib\site-packages\pyparsing.py", line 3539, in
<module>
_escapedPunc = Word( _bslash, r"\[]-*.$+^?()~ ", exact=2 ).setParseAction(la
mbda s,l,t:t[0][1])
File "C:\Anaconda2\envs\mypackage\lib\site-packages\pyparsing.py", line 966, in
setParseAction
self.parseAction = list(map(_trim_arity, list(fns)))
File "C:\Anaconda2\envs\mypackage\lib\site-packages\pyparsing.py", line 813, in
_trim_arity
this_line = extract_stack()[-1]
File "C:\Anaconda2\envs\mypackage\lib\site-packages\pyparsing.py", line 797, in
extract_stack
frame_summary = traceback.extract_stack()[offset]
File "C:\Anaconda2\envs\mypackage\lib\traceback.py", line 207, in extract_stack
stack = StackSummary.extract(walk_stack(f), limit=limit)
File "C:\Anaconda2\envs\mypackage\lib\traceback.py", line 358, in extract
f.line
File "C:\Anaconda2\envs\mypackage\lib\traceback.py", line 282, in line
self._line = linecache.getline(self.filename, self.lineno).strip()
File "C:\Anaconda2\envs\mypackage\lib\linecache.py", line 16, in getline
lines = getlines(filename, module_globals)
File "C:\Anaconda2\envs\mypackage\lib\linecache.py", line 47, in getlines
return updatecache(filename, module_globals)
File "C:\Anaconda2\envs\mypackage\lib\linecache.py", line 137, in updatecache
lines = fp.readlines()
File "C:\Anaconda2\envs\mypackage\lib\codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 308: invali
d start byte
Commenting out the import matplotlib as mpl causes the error not to occur. This led me astray trying different combinations of matplot, numpy, etc. The part that confuses me is that if I delete the comments (that I pasted from the web) the error is actually fixed. My editor is vim. I guess utf-8 was not the encoding that vim used to write the file.
Minimal error producing example:
# -*- coding: utf-8 -*-
import matplotlib as mpl
# Bad character pasted into vim from chrome: –
To fix just remove the "EN DASH" (or the entire line 3) and the matplotlib imports correctly.
So why does the invalid(?) unicode in the comments cause an error only when trying to import matplotlib(and before it even reaches the comment in question)
python==3.5.2
colorama==0.3.7
comtypes==1.1.2
cycler==0.10.0
matplotlib==1.5.1
numpy==1.11.1
pandas==0.18.1
py==1.4.31
pyparsing==2.1.4
pytest==2.9.2
python-dateutil==2.5.3
pytz==2016.6.1
pywin32==220
scikit-learn==0.17.1
scipy==0.18.0
six==1.10.0
The problem is in pyparsing:
The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you don't need to learn a new syntax for defining grammars or matching expressions - the parsing module provides a library of classes that you use to construct the grammar directly in Python.
In order to "construct the grammar directly in Python", pyparsing needs to read the source file (in this case a matplotlib source file) where the grammar is defined. In what would usually just be a bit of harmless extra work, pyparsing is reading not just the matplotlib source file but everything in the stack at the point the grammar is defined, all the way down to the source file where you have your import matplotlib. When it reaches your source file it chokes, because your file indeed is not in UTF-8; 0x96 is the Windows-1252 (and/or Latin-1) encoding for the en dash. This issue (reading too much of the stack) has already been fixed by the author of pyparsing so the fix should be in the next release of pyparsing (probably 2.1.8).
By the way, matplotlib is defining a pyparsing grammar in order to be able to read fontconfig files, which are a way of configuring fonts used mainly on Linux. So on Windows pyparsing is probably not even required to use matplotlib!
I am just starting to use and learn Python, so this may seem vary naive to ask.
On my Linux system if i try to get a webpage using urllib.urlopen() I get an error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/urllib.py", line 86, in urlopen
return opener.open(url)
File "/usr/lib/python2.7/urllib.py", line 207, in open
return getattr(self, name)(url)
File "/usr/lib/python2.7/urllib.py", line 344, in open_http
h.endheaders(data)
File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 814, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 776, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 757, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
IOError: [Errno socket error] [Errno -2] Name or service not known
>>>
If I try to do the same in the Python 2.7 installed in my Windows 7 system, it works fine.
Since i am a novice, its difficult for me to diagnose the problem. I tried to research it but still haven't got any answers.
So my questions are:
What is different in the windows system that urlopen() works there but not on Linux.
What needs to be done to ensure that urlopen() works on the Linux system. Its necessary for me that it works since the the program I am developing has some bash command calls and the program depends extensively on the proper working of urllib.