Questions tagged [pycharm]

PyCharm is an integrated development environment (IDE) for Python. It is developed by JetBrains for Windows, Mac OS X and Linux. DO NOT use this tag on questions regarding code which merely happens to be written using PyCharm, use the appropriate language tag [python] instead.

PyCharm is an integrated development environment (IDE) for Python, developed by JetBrains. It is available on Windows, OS X and Linux.

It provides support for common Python frameworks such as Django, Flask, Pyramid and others.

Starting with version 3, a free and open-source edition of PyCharm was released; along with a professional (paid) edition.

If you have found a bug, it is usually better to report it at the public bug tracker.

For more information, browse the following:

  1. The official product page.
  2. The public bugtracker.
  3. Product blog.
  4. Support page.
16686 questions
6
votes
1 answer

How to save code folding after IDE restart?

I've tried to use code regions https://www.jetbrains.com/help/pycharm-edu/code-folding.html#surrounding_with_comments , folded some regions and restarted PyCharm. When IDE has been restarted, all folded code regions were expanded. How to save code…
Arthur
  • 3,253
  • 7
  • 43
  • 75
6
votes
1 answer

Pycharm complains about using [] operator with pytorch's nn.ModuleList object

Pycharm's type-checking complains about the following block of code (taken from pytorch's docs): import torch.nn as nn class MyModule(nn.Module): def __init__(self): super(MyModule, self).__init__() self.linears =…
Michael Heidelberg
  • 993
  • 11
  • 24
6
votes
2 answers

ImportError: libavcodec.so.57: cannot open shared object file: No such file or directory

I am working on a python project and I am sadly experienced that once I attempt to run the script from the PyCharm ide I get the following error message: from .cv2 import * ImportError: libavcodec.so.57: cannot open shared object file: No such file…
DalekSupreme
  • 1,493
  • 3
  • 19
  • 32
6
votes
0 answers

Prevent PyCharm from overwriting PYTHONPATH in remote Docker interpreter

I've set up a remote Docker interpreter in PyCharm 2019.2, where I'm able to connect and run a simple Python script just fine. However, the Docker image that I'm trying to use (ros:kinetic-ros-base) makes some modifications to $PYTHONPATH in its…
Nick Faughey
  • 584
  • 1
  • 5
  • 10
6
votes
1 answer

How to run python script with mpi4py (using mpiexec) from within pycharm?

I have a python script that depends on mpi4py implementation of MPI. This needs to be run through mpiexec (or mpirun). My Question is : How to run (and hopefully debug) a python script using mpiexec (or mpirun) from PyCharm directly? Running mpiexec…
Amr ALHOSSARY
  • 196
  • 1
  • 14
6
votes
9 answers

How to fix Tkinter? Every code with GUI crashes mac os with respring

I was practicing tkinter with PyCharm for my own project with serial and arduino. Nothing special about it - few buttons, option-menu and labels. But I clicked on Mac's menu bar in the tkinter's GUI window on the option "Show tab bar". And then…
Denis Omelchenko
  • 69
  • 1
  • 1
  • 4
6
votes
0 answers

Mix use of Emacs and macOS key bindings in PyCharm

Is there any easy way to mix Emacs-like key bindings and macOS-like key bindings in PyCharm Professional 2019.2 for macOS? The Emacs keymap provided with PyCharm enables Ctrl-P, Ctrl-S, Ctrl-K, and so on. But it disables ⌘-N,``⌘-P, and other…
Akira Okumura
  • 1,816
  • 2
  • 20
  • 41
6
votes
1 answer

How to fix"NameError: name 'load_model' is not defined"

I am reading the book"Deep Learning with Python" and I have come across a problem. I have used Pycharm to save models in anther file and when I tried to load it by the function 'load_model()', the system supports that 'NameError: name 'load_model'…
Karin
  • 61
  • 1
  • 1
  • 2
6
votes
1 answer

Delete PyCharm and all associated directories

PyCharm Version 2019.1.3 OS: macOS 10.15 Beta I am trying to delete PyCharm and all associated directories. I did some research and found for example this post: rm -fv /usr/local/bin/charm rm -rfv ~/Library/Preferences/PyCharm?0 rm -rfv…
Prydwen
  • 531
  • 4
  • 11
6
votes
1 answer

Cannot import module from source directory in pycharm

This question has been asked before - but i could not solve it with any of the answers. I opned a project folder in pycharm (note that the project folder is not in the ../PycharmProject/... directory. My structure is super basic: project_title…
Tytire Recubans
  • 967
  • 10
  • 27
6
votes
0 answers

how to configure pycharm so that it will work with kaggle kernel python notebook?

I am using the latest version of pycharm, pychram pro 2.19.1.2. This version is supposed to have jupyter notebook support. I have some personal kernels on kaggle and I want to know how I can edit my kernel directly from pycharm IDE rather than…
Omer Anisfeld
  • 1,236
  • 12
  • 28
6
votes
0 answers

How to type hint a return value for a function decorated to alter the function return?

I'm writing a Python package which makes use of decorators to remove boilerplate code while introspecting the function to get the function name by default. Something like the following: def make_real_instance(func: Optional[Callable] = None, …
PMende
  • 5,171
  • 2
  • 19
  • 26
6
votes
1 answer

How to tell PyCharm that async fixture returns something

Example: import pytest @pytest.fixture async def phrase(): return 'hello world' @pytest.fixture async def replaced(phrase): return phrase.replace('hello', 'goodbye') The method .replace is yellow-colored and the warning says: Unresolved…
sanyassh
  • 8,100
  • 13
  • 36
  • 70
6
votes
3 answers

How to set path to unrar library in Python?

I am using Pycharm as my IDE (Python 3.7) and am trying to extract a password protected .rar file (I know the password) and have imported rarfile from unrar but am getting this error "LookupError: Couldn't find path to unrar library." I also…
6
votes
3 answers

Pycharm and .rst --- NameError: Cannot find docutils in selected interpreter

I'm new to Pycharm as well as writing .rst files. I'm currently trying to debug some issue that prevents my .rst file from rendering properly. I want to use the .rst preview that Pycharm provides, but I get this error: NameError: Cannot find…
Kyle U
  • 305
  • 3
  • 12