Categories
Mastering Development

TypeError: not expecting type ‘

I’m trying to install some packages for IronPython 2.7 using this command: >C:\Program Files\IronPython 2.7\> ipy -X:Frames -m pip install (PackageName) And I keep getting these blocks of error messages. >ERROR: Exception: Traceback (most recent call last): File “C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\cli\base_command.py”, line 188, in _main status = self.run(options, args) File “C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\cli\req_command.py”, line 185, […]

Categories
Linux Mastering Development Ubuntu

UnboundLocalError: local variable ‘updates_end’ referenced before assignment

I am attempting to upgrade my Ubuntu 19.10 to 20.04 before it goes EOL in July. The command do-release-upgrade results in quite a few errors, many Python-related: Traceback (most recent call last): File “/tmp/ubuntu-release-upgrader-xd3_uwv2/focal”, line 8, in <module> sys.exit(main()) File “/tmp/ubuntu-release-upgrader-xd3_uwv2/DistUpgrade/DistUpgradeMain.py”, line 238, in main if app.run(): File “/tmp/ubuntu-release-upgrader-xd3_uwv2/DistUpgrade/DistUpgradeController.py”, line 2082, in run return self.fullUpgrade() […]

Categories
Linux Mastering Development

Error with Keyring when connection from ssh

Due to COVID-19 we are working from home. Now I have a linux (Ubuntu) pc at my workplace which has TortoiseHG Workbench installed. I connect via MobaXTerm to my computer over ssh. Normally when I try to update the repo it works due to the password and user is saved in the keyring. Now when […]

Categories
Mastering Development

run_until_complete fails even after loop has been stopped

Im trying to write a SIGTERM-handler that will have my run_forever()-loop Stop accepting new tasks. Complete running tasks. Shutdown. Here is a learning-demo I wrote: import asyncio import signal import logging logging.basicConfig(level=logging.INFO, format=’%(asctime)s %(levelname)s [%(name)s]: %(message)s’, datefmt=’%H:%M:%S’) _log = logging.getLogger(__name__) class Looper: def __init__(self, loop): self._loop = loop self._shutdown = False signal.signal(signal.SIGINT, self._exit) signal.signal(signal.SIGTERM, self._exit) […]

Categories
Development

Azure databricks: KafkaUtils createDirectStream causes Py4JNetworkError(“Answer from Java side is empty”) error

In Azure databricks, I tried to create a kafka stream in notebook and used it to create a spark job. Databricks throw error at the line KafkaUtils.createDirectStream(). Attached the correponding code below. from kazoo.client import KazooClient from pyspark.streaming import StreamingContext from pyspark.streaming.kafka import KafkaUtils, TopicAndPartition sc = spark.sparkContext ssc = StreamingContext(sc, 30) print(‘SSC created:: {}’.format(ssc)) […]

Categories
Development

Unable to import method from another python file

I am currently working on a backend api based off of this example: https://github.com/gothinkster/flask-realworld-example-app I am new to python and I am having an issue with getting imports to work. I am simply not understanding the import rules that python follows based on the inconsistencies that I am noticing in the ability to import the […]