UnicodeDecodeError: invalid start byte in METADATA file at path: - python-3.x

I see that several Python-package related files have gibberish at their end.
Due to this, I am unable to do several pip operations (even basic ones like "pip list").
(Usually, I use conda by the way)
For example. When I pressed pip list. I get the following error.
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\shan_jaffry\Miniconda3\envs\SQL_version\lib\site-packages\pip\_internal\cli\base_command.py", line 173, in _main
status = self.run(options, args)
File "C:\Users\shan_jaffry\Miniconda3\envs\SQL_version\lib\site-packages\pip\_internal\commands\list.py", line 179, in run
self.output_package_listing(packages, options)
File "C:\Users\shan_jaffry\Miniconda3\envs\SQL_version\lib\site-packages\pip\_internal\commands\list.py", line 255, in output_package_listing
data, header = format_for_columns(packages, options)
File "C:\Users\shan_jaffry\Miniconda3\envs\SQL_version\lib\site-packages\pip\_internal\commands\list.py", line 307, in format_for_columns
row = [proj.raw_name, str(proj.version)]
File "C:\Users\shan_jaffry\Miniconda3\envs\SQL_version\lib\site-packages\pip\_internal\metadata\base.py", line 163, in raw_name
return self.metadata.get("Name", self.canonical_name)
File "C:\Users\shan_jaffry\Miniconda3\envs\SQL_version\lib\site-packages\pip\_internal\metadata\pkg_resources.py", line 96, in metadata
return get_metadata(self._dist)
File "C:\Users\shan_jaffry\Miniconda3\envs\SQL_version\lib\site-packages\pip\_internal\utils\packaging.py", line 48, in get_metadata
metadata = dist.get_metadata(metadata_name)
File "C:\Users\shan_jaffry\Miniconda3\envs\SQL_version\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1424, in get_metadata
return value.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfd in position 14097: invalid start byte in METADATA file at path: c:\users\shan_jaffry\miniconda3\envs\sql_version\lib\site-packages\hupper-1.10.2.dist-info\METADATA
I went into the file META and found the following gibberish at the end. This (I found) has been done in several other files i.e. end of files are appended with gibberish and the actual thin is removed. Any help?
> 0.1 (2016-10-21)
> ================
> -
> - Initial rele9ýl·øA

I found that the by manually going to the site-packages folder, and removing the two folders, :: hupper and hupper-1.10.2.dist-info and then installing hupper again using "pip install hupper", problem was solved.
The issue was that the hupper package (and hupper-1.10.2.dist-info) were corrupted. Hence uninstall and re-install helped.

Related

Stable diffusion with openVino: Failed to set input blob with precision: I64, if CNNNetwork input blob precision is: FP64

I'm trying to make this version work on my CPU (Linux):
https://github.com/bes-dev/stable_diffusion.openvino
And it works fine without any initial image. But when I try to pass an initial image, I get this error:
Traceback (most recent call last):
File "/home/ideruga/workspace/stable_diffusion.openvino/demo.py", line 79, in <module>
main(args)
File "/home/ideruga/workspace/stable_diffusion.openvino/demo.py", line 39, in main
image = engine(
File "/home/ideruga/workspace/stable_diffusion.openvino/stable_diffusion_engine.py", line 188, in __call__
noise_pred = result(self.unet.infer_new_request({
File "/home/ideruga/anaconda3/lib/python3.9/site-packages/openvino/runtime/ie_api.py", line 266, in infer_new_request
return self.create_infer_request().infer(inputs)
......
File "/home/ideruga/anaconda3/lib/python3.9/site-packages/openvino/runtime/ie_api.py", line 31, in set_scalar_tensor
request.set_tensor(key, tensor)
RuntimeError: [ PARAMETER_MISMATCH ] Failed to set input blob with precision: I64, if CNNNetwork input blob precision is: FP64
It's bizarre, because I am not messing with any parameters. It's as if model that it downloads is not compatible with parsed input image.
I've actually found a bug in the linked repository, I'll submit a fix later today. The used model expects f64 but is fed with i64 value. I'll post a comment with the PR when it's submitted.

I am getting this error: MermaidExtension.extendMarkdown() missing 1 required positional argument: 'md_globals'

This was working not too long ago (probably inadvertently upgraded a library somewhere.) All of my libraries are up to date.
Here is the stack trace:
File "C:\Users\jorda\Documents\projects\python\poolBoy\flaskApp.py", line 422, in about
html += markdown.markdown(text, extensions=['md_mermaid', 'fenced_code', 'tables'])
File "C:\Users\jorda\Documents\projects\python\poolBoy\venv\lib\site-packages\markdown\core.py", line 386, in markdown
md = Markdown(**kwargs)
File "C:\Users\jorda\Documents\projects\python\poolBoy\venv\lib\site-packages\markdown\core.py", line 96, in __init__
self.registerExtensions(extensions=kwargs.get('extensions', []),
File "C:\Users\jorda\Documents\projects\python\poolBoy\venv\lib\site-packages\markdown\core.py", line 125, in registerExtensions
ext.extendMarkdown(self)
TypeError: MermaidExtension.extendMarkdown() missing 1 required positional argument: 'md_globals'
Any suggestions would be most appreciated!
Must have upgraded Markdown inadvertently. I added the following to my requirements and it is working fine now:
Markdown<3.2

Ansible with Mitogen: Crash when two or more maschines

I'm trying to use the ansible strategy mitogen_linear. Once I try to run a playbook with more then one maschine its crashes as follows.
I'm running this on a Debian 11 over WSL v2 with kernel version 5.10.102.1.
ERROR! [mux 12903] 17:51:03.129739 E mitogen: <Stream ssh.proxyserver02 #5730> crashed
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/mitogen/core.py", line 3488, in _call
func(self)
File "/usr/lib/python3/dist-packages/mitogen/core.py", line 1726, in on_transmit
self.protocol.on_transmit(broker)
File "/usr/lib/python3/dist-packages/mitogen/core.py", line 2174, in on_transmit
self._writer.on_transmit(broker)
File "/usr/lib/python3/dist-packages/mitogen/core.py", line 1914, in on_transmit
written = self._protocol.stream.transmit_side.write(buf)
File "/usr/lib/python3/dist-packages/mitogen/core.py", line 2040, in write
written, disconnected = io_op(os.write, self.fd, s)
File "/usr/lib/python3/dist-packages/mitogen/core.py", line 553, in io_op
return func(*args), None
BlockingIOError: [Errno 11] Resource temporarily unavailable
fatal: [proxyserver02]: UNREACHABLE! => changed=false
msg: Channel was disconnected while connection attempt was in progress; this may be caused by an abnormal Ansible exit, or due to an unreliable target.
unreachable: true

Dataflow job fails with HttpError, NotImplementedError

I'm running a Dataflow job which I think should work, and is failing after 1.5 hrs with what looks like network errors. It works fine when run against a subset of the data.
The first trouble sign is a whole string of warnings like this:
Refusing to split <dataflow_worker.shuffle.GroupedShuffleRangeTracker object at 0x7f2bcb629950> at b'\xa4r\xa6\x85\x00\x01': proposed split position is out of range [b'\xa4^E\xd2\x00\x01', b'\xa4r\xa6\x85\x00\x01'). Position of last group processed was b'\xa4r\xa6\x84\x00\x01'.
Then there are four errors which seem to be about writing CSV files to GCS:
Error in _start_upload while inserting file gs://(redacted).csv: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/apache_beam/io/gcp/gcsio.py", line 565, in _start_upload self._client.objects.Insert(self._insert_request, upload=self._upload) File "/usr/local/lib/python3.7/site-packages/apache_beam/io/gcp/internal/clients/storage/storage_v1_client.py", line 1156, in Insert upload=upload, upload_config=upload_config) File "/usr/local/lib/python3.7/site-packages/apitools/base/py/base_api.py", line 731, in _RunMethod return self.ProcessHttpResponse(method_config, http_response, request) File "/usr/local/lib/python3.7/site-packages/apitools/base/py/base_api.py", line 737, in ProcessHttpResponse self.__ProcessHttpResponse(method_config, http_response, request)) File "/usr/local/lib/python3.7/site-packages/apitools/base/py/base_api.py", line 604, in __ProcessHttpResponse http_response, method_config=method_config, request=request) apitools.base.py.exceptions.HttpError: HttpError accessing <https://www.googleapis.com/resumable/upload/storage/v1/b/(redacted).csv&uploadType=resumable&upload_id=(redacted)>: response: <{'content-type': 'text/plain; charset=utf-8', 'x-guploader-uploadid': '(redacted)', 'content-length': '0', 'date': 'Wed, 08 Jul 2020 22:17:28 GMT', 'server': 'UploadServer', 'status': '503'}>, content <>
Error in _start_upload while inserting file gs://(redacted).csv: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/apache_beam/io/gcp/gcsio.py", line 565, in _start_upload self._client.objects.Insert(self._insert_request, upload=self._upload) File "/usr/local/lib/python3.7/site-packages/apache_beam/io/gcp/internal/clients/storage/storage_v1_client.py", line 1156, in Insert upload=upload, upload_config=upload_config) File "/usr/local/lib/python3.7/site-packages/apitools/base/py/base_api.py", line 715, in _RunMethod http_request, client=self.client) File "/usr/local/lib/python3.7/site-packages/apitools/base/py/transfer.py", line 908, in InitializeUpload return self.StreamInChunks() File "/usr/local/lib/python3.7/site-packages/apitools/base/py/transfer.py", line 1020, in StreamInChunks additional_headers=additional_headers) File "/usr/local/lib/python3.7/site-packages/apitools/base/py/transfer.py", line 971, in __StreamMedia self.RefreshResumableUploadState() File "/usr/local/lib/python3.7/site-packages/apitools/base/py/transfer.py", line 873, in RefreshResumableUploadState self.stream.seek(self.progress) File "/usr/local/lib/python3.7/site-packages/apache_beam/io/filesystemio.py", line 301, in seek offset, whence, self.position, self.last_block_position)) NotImplementedError: offset: 0, whence: 0, position: 411, last: 411
The Dataflow job ID is 2020-07-07_13_08_31-7649894576933400587 -- if anyone from Google Cloud Support is able to look at this I'd be very grateful. Thanks very much.
P.S I asked a similar question last year (Dataflow job fails at BigQuery write with backend errors), the resolution was to use --experiments=use_beam_bq_sink -- I am already doing this.
You can safely ignore "Refusing to split" errors. This just means that the split position Dataflow service provided probably was received by the worker after that position was already read by the worker. Hence the worker has to ignore the split request.
Error "Error in _start_upload while inserting" seems more problematic and seems to be similar to https://issues.apache.org/jira/browse/BEAM-7014. I suspect this to be a rare flake though so I'm not sure if this was the reason for your job failure (the job only fails of the same workitem failed four times).
Can you contact Google Cloud support so that they can look into your job ?
I will mention this in the JIRA.

stripe.error.APIConnectionError connected to openssl

I am dealing with the following error
Traceback (most recent call last):
File "once.py", line 1757, in <module>
once()
File "once.py", line 55, in once
stripe.Charge.all()
File "/Library/Python/2.7/site-packages/stripe/resource.py", line 438, in all
return cls.list(*args, **params)
File "/Library/Python/2.7/site-packages/stripe/resource.py", line 450, in list
response, api_key = requestor.request('get', url, params)
File "/Library/Python/2.7/site-packages/stripe/api_requestor.py", line 150, in request
method.lower(), url, params, headers)
File "/Library/Python/2.7/site-packages/stripe/api_requestor.py", line 281, in request_raw
method, abs_url, headers, post_data)
File "/Library/Python/2.7/site-packages/stripe/http_client.py", line 139, in request
self._handle_request_error(e)
File "/Library/Python/2.7/site-packages/stripe/http_client.py", line 159, in _handle_request_error
raise error.APIConnectionError(msg)
stripe.error.APIConnectionError: Unexpected error communicating with Stripe. If this problem persists,
let us know at support#stripe.com.
I get this error when running a simple test program which stripe suggested
import stripe
stripe.api_key = "blah bla"
stripe.api_base = "https://api-tls12.stripe.com"
print "stripe.VERSION = ", stripe.VERSION
if stripe.VERSION in ("1.13.0", "1.14.0", "1.14.1", "1.15.1", "1.16.0", "1.17.0", "1.18.0", "1.19.0"):
print "Bindings update required."
try:
stripe.Charge.all()
print "TLS 1.2 supported, no action required."
except stripe.error.APIConnectionError:
print "TLS 1.2 is not supported. You will need to upgrade your integration."
raise
I do not understand why I get this error, since my stripe version is high enough
stripe.VERSION = 1.55.2
and my openssl version does support TLS?
>>$ openssl version
OpenSSL 1.0.2k 26 Jan 2017
>>$ which openssl
/usr/bin/openssl
any ideas how to debug this further? I am lost...
ok I don't know what exactly caused the problem, but I got it working by changing the client
client = stripe.http_client.PycurlClient()
stripe.default_http_client = client
I think the requests package is the default. pycurl seems to work in my case...

Resources