Skip to content
Advertisement

Tag: pycharm

Pycharm’s “stop” does not run finally code

I am running a python project in pycharm. In the code we have a main “try-catch-finally” block e.g. If I run the program in the terminal it will reach the finally block when I press our quit button or “ctrl-c” and perform the post processing required. However, after pressing “stop” when using the run tool in PyCharm it just quits

Cannot connect to localhost:63342 when using matplotlib in PyCharm’s Python scientific plotting

My PyCharm’s scientific plotting mode doesn’t work on localhost (not remote). It reports: My matplotlib with the show plots in tool window in Tools -> Python Scientific unchecked (plot in original window instead of in SciView) worked normally. Changing a few options such as debugging server’s port and python’s interpreter (anaconda3 (Python 3.7) and pure version of Python 3.8.3) does

CuDNN crash in TF 2.x after many epochs of training

I’m currently becoming more and more desperate concerning my tensorflow project. It took many hours installing tensorflow until I figured out that PyCharm, Python 3.7 and TF 2.x are somehow not compatible. Now it is running, but I get a really unspecific CuDNN error after many epochs of training. Do you know if my code is wrong or if there

Avoiding Default Argument Value is Mutable Warning (PyCharm) [duplicate]

This question already has answers here: Why does PyCharm warn about mutable default arguments? How can I work around them? (5 answers) Closed 1 year ago. Code: Output: When running the code above, the output is as expected however PyCharm doesn’t like it when I pass a list/dictionary (mutable) into the lambda function. To my understanding, it is bad practice

PyCharm Matplotlib “UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. plt.show()”

I am having problems with matplotlib.pyplot.show() function. I am using PyCharm on Linux, and i have a VirtualEnv. When i execute the file x.py in the built terminal in PyCharm (using venv) like this $ python x.py everything works fine, the function plt.show() renders and shows the plotted graph well. i did add print(matplotlib.get_backend()) to see which backend was used

Why are type hints for variables not handled as type hints for function parameters?

When writing a function in Python with type hints like this: It translates to this type hint: Optional[Token]. With optional, a None value is accepted too. When writing the same type hint for a class field, it doesn’t behave the same: Here type hint checkers like the integrated one in PyCharm reports: Expected type ‘Token’, got None instead. My questions

Read avro files in pyspark with PyCharm

I’m quite new to spark, I’ve imported pyspark library to pycharm venv and write below code: , everything seems to be okay but when I want to read avro file I get message: pyspark.sql.utils.AnalysisException: ‘Failed to find data source: avro. Avro is built-in but external data source module since Spark 2.4. Please deploy the application as per the deployment section

Advertisement