Python
This section provides descriptions of the Python-specific procedures that are used in projects of all supported types, and the procedures that pertain to the empty projects only.
In this section:
- Python
- Creating Empty Project
- Configuring Python Interpreter
- Configuring Remote Interpreters via Deployment Configuration
- Configuring Remote Interpreters via Docker
- Configuring Remote Interpreters via Docker Compose
- Configuring Remote Interpreters via SSH
- Configuring Remote Interpreters via Vagrant
- Configuring Remote Interpreters via WSL
- Conda Support. Creating Conda Environment
- Installing, Uninstalling and Reloading Interpreter Paths
- Changing Name of a Python Interpreter or Virtual Environment
- Remote Development on Raspberry Pi
- Installing, Uninstalling and Upgrading Packages
- Managing Dependencies
- Creating and Optimizing Imports
- Resolving References
- Cleaning .pyc Files
- Optimizing Your Code Using Profilers
- Cython Support
- Buildout
- Documenting Source Code in PyCharm
- Running
- Debugging
- Breakpoints
- Configuring Debugger Options
- Cython Speedups
- Starting the Debugger Session
- Pausing and Resuming the Debugger Session
- Monitoring the Debug Information
- Examining Suspended Program
- Exploring Frames
- Finding the Current Execution Point
- Stepping Through the Program
- Remote Debugging
- Inline Debugging
- Using Debug Console
- Attaching to Local Process
- Thread Concurrency Visualization
- Viewing as Array or DataFrame
- Testing
- Deploying Your Code
- Shipping Your Code
Prerequisite
At least one Python interpreter is properly installed on your machine.
Python Support
PyCharm supports Python from version 2.4 up to the version 3.6.
PyCharm provides support for Python 3.5 and (since 2016.3) Python 3.6, with the backing of the following:
- PEP-0484 -- Type Hints
- PEP 0448 -- Additional Unpacking Generalizations
- PEP 0492 -- Coroutines with async and await syntax
- PEP 526 -- Syntax for variable annotations
- PEP 498 -- Literal String Interpolation
- PEP 515 -- Underscores in Numeric Literals
- PEP 525 -- Asynchronous Generators
- PEP 530 -- Asynchronous Comprehensions
- and more.
Python support in PyCharm includes:
- Dedicated project types .
- Ability to configure local and remote interpreters and virtual environments. and virtual environments.
- Python console.
- Run/debug configurations for Python, and Python remote debug.
- Code inspections.
- Intention actions.
- Code completion and resolve.
- Built-in code formatter and separate set of Python code style settings.
- Find usages in Python code.
- Testing frameworks.
- Quick documentation.
- Recognizing Python documentation comments.
- Documentation generators
- Configuring Python debugger.
Note that the debugger contains speedup modules, which use Cython and are generated with a few changes in the regular files to cythonize the files. The Cython speedups are available for CPython versions 2.7, 3.4 and 3.5.
- On Windows the compiled Cython extensions are bundled to PyCharm.
- On Linux and macOS, Cython extensions should be compiled manually in one in two possible ways:
- by clicking the link that appears in the warning after the first debugger launch.
- by running the command from the warning manually in the terminal. A separate Cython extension should be compiled for each version of Python interpreter.
If someone doesn't want to use Cython extensions for some reasons, the environment variable
PYDEVD_USE_CYTHON=NO
should be passed.
- UML Class diagrams for Python classes.