python-pptx 0.6.23
pip install python-pptx Copy PIP instructions
Released: Nov 2, 2023
Generate and manipulate Open XML PowerPoint (.pptx) files
Verified details
Maintainers.
Unverified details
Project links, github statistics.
- Open issues:
View statistics for this project via Libraries.io , or by using our public dataset on Google BigQuery
License: MIT License (MIT)
Author: Steve Canny
Tags powerpoint, ppt, pptx, office, open, xml
Classifiers
- OSI Approved :: MIT License
- OS Independent
- Python :: 2
- Python :: 2.7
- Python :: 3
- Python :: 3.6
- Office/Business :: Office Suites
- Software Development :: Libraries
Project description
python-pptx is a Python library for creating, reading, and updating PowerPoint (.pptx) files.
A typical use would be generating a PowerPoint presentation from dynamic content such as a database query, analytics output, or a JSON payload, perhaps in response to an HTTP request and downloading the generated PPTX file in response. It runs on any Python capable platform, including macOS and Linux, and does not require the PowerPoint application to be installed or licensed.
It can also be used to analyze PowerPoint files from a corpus, perhaps to extract search indexing text and images.
In can also be used to simply automate the production of a slide or two that would be tedious to get right by hand, which is how this all got started.
More information is available in the python-pptx documentation .
Browse examples with screenshots to get a quick idea what you can do with python-pptx.
Release History
0.6.23 (2023-11-02), 0.6.22 (2023-08-28).
(Windows Python 3.10+)
0.6.21 (2021-09-20)
0.6.20 (2021-09-14), 0.6.19 (2021-05-17), 0.6.18 (2019-05-02).
.text property getters encode line-break as a vertical-tab (VT, ‘v’, ASCII 11/x0B). This is consistent with PowerPoint’s copy/paste behavior and allows like-breaks (soft carriage-return) to be distinguished from paragraph boundary. Previously, a line-break was encoded as a newline (’n’) and was not distinguishable from a paragraph boundary.
.text properties include Shape.text, _Cell.text, TextFrame.text, _Paragraph.text and _Run.text.
.text property setters accept vertical-tab character and place a line-break element in that location. All other control characters other than horizontal-tab (’t’) and newline (’n’) in range x00-x1F are accepted and escaped with plain-text like “_x001B” for ESC (ASCII 27).
Previously a control character other than tab or newline in an assigned string would trigger an exception related to invalid XML character.
0.6.17 (2018-12-16)
0.6.16 (2018-11-09), 0.6.15 (2018-09-24), 0.6.14 (2018-09-24), 0.6.13 (2018-09-10), 0.6.12 (2018-08-11), 0.6.11 (2018-07-25), 0.6.10 (2018-06-11), 0.6.9 (2018-05-08), 0.6.8 (2018-04-18), 0.6.7 (2017-10-30), 0.6.6 (2017-06-17), 0.6.5 (2017-03-21), 0.6.4 (2017-03-17), 0.6.3 (2017-02-28), 0.6.2 (2017-01-03).
BACKWARD INCOMPATIBILITIES:
Some changes were made to the boilerplate XML used to create new charts. This was done to more closely adhere to the settings PowerPoint uses when creating a chart using the UI. This may result in some appearance changes in charts after upgrading. In particular:
0.6.1 (2016-10-09)
0.6.0 (2016-08-18), 0.5.8 (2015-11-27), 0.5.7 (2015-01-17).
Shape.shape_type is now unconditionally MSO_SHAPE_TYPE.PLACEHOLDER for all placeholder shapes. Previously, some placeholder shapes reported MSO_SHAPE_TYPE.AUTO_SHAPE , MSO_SHAPE_TYPE.CHART , MSO_SHAPE_TYPE.PICTURE , or MSO_SHAPE_TYPE.TABLE for that property.
0.5.6 (2014-12-06)
0.5.5 (2014-11-17), 0.5.4 (2014-11-15), 0.5.3 (2014-11-09), 0.5.2 (2014-10-26), 0.5.1 (2014-09-22), 0.5.0 (2014-09-13).
A table is no longer treated as a shape. Rather it is a graphical object contained in a GraphicFrame shape, as are Chart and SmartArt objects.
As the enclosing shape, the id, name, shape type, position, and size are attributes of the enclosing GraphicFrame object.
The contents of a GraphicFrame shape can be identified using three available properties on a shape: has_table, has_chart, and has_smart_art. The enclosed graphical object is obtained using the properties GraphicFrame.table and GraphicFrame.chart. SmartArt is not yet supported. Accessing one of these properties on a GraphicFrame not containing the corresponding object raises an exception.
0.4.2 (2014-04-29)
0.4.1 (2014-04-29).
The following enumerations were moved/renamed during the rationalization of enumerations:
Documentation for all enumerations is available in the Enumerations section of the User Guide.
0.3.2 (2014-02-07)
0.3.1 (2014-01-10), 0.3.0 (2013-12-12), 0.2.6 (2013-06-22), 0.2.5 (2013-06-11), 0.2.4 (2013-05-16), 0.2.3 (2013-05-05), 0.2.2 (2013-03-25), 0.2.1 (2013-02-25), 0.2.0 (2013-02-10).
First non-alpha release with basic capabilities:
Project details
Release history release notifications | rss feed.
Nov 2, 2023
Aug 29, 2023
Sep 20, 2021
Sep 14, 2021
May 17, 2021
May 3, 2019
Dec 16, 2018
Nov 10, 2018
Sep 24, 2018
Sep 10, 2018
Aug 12, 2018
Jul 25, 2018
Jun 11, 2018
May 9, 2018
Apr 18, 2018
Oct 30, 2017
Jun 18, 2017
Mar 22, 2017
Mar 17, 2017
Feb 28, 2017
Jan 3, 2017
Oct 9, 2016
Aug 18, 2016
Nov 28, 2015
Jan 18, 2015
Dec 7, 2014
Nov 18, 2014
Nov 16, 2014
Nov 10, 2014
Oct 27, 2014
Sep 22, 2014
Sep 14, 2014
Apr 30, 2014
Feb 7, 2014
Jan 10, 2014
Dec 13, 2013
0.3.0rc1 pre-release
Jun 22, 2013
Jun 12, 2013
May 17, 2013
May 6, 2013
Mar 26, 2013
Feb 25, 2013
Feb 11, 2013
0.1.0a1 pre-release
Jan 26, 2013
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages .
Source Distribution
Uploaded Nov 2, 2023 Source
Built Distribution
Uploaded Nov 2, 2023 Python 3
Hashes for python-pptx-0.6.23.tar.gz
Hashes for python_pptx-0.6.23-py3-none-any.whl.
- português (Brasil)
Supported by
- Python Basics
- Interview Questions
- Python Quiz
- Popular Packages
- Python Projects
- Practice Python
- AI With Python
- Learn Python3
- Python Automation
- Python Web Dev
- DSA with Python
- Python OOPs
- Dictionaries
- Creating and updating PowerPoint Presentations in Python using python - pptx
- Creating Your Own Python IDE in Python
- How to generate a documentation using Python?
- Creating Digital Clock Using Date Shower in Python
- Convert the .PNG to .GIF and it's vice-versa in Python
- Generating Beautiful Code Snippets using Python
- Taking Screenshots using pyscreenshot in Python
- How to update a plot on same figure during the loop?
- How to create MS Paint clone with Python and PyGame?
- Creating Your First Application in Python
- How to Add Audio to Powerpoint Presentation
- How to Save PowerPoint Presentations as PDF Files using MS PowerPoint?
- How to Create a MS PowerPoint Presentation in Java with a Maven Project?
- How to Edit a Powerpoint Presentation?
- 10 PowerPoint Presentation Tips to Make More Creative Slideshows
- What is the purpose of the PPTM file in PowerPoint?
- Applying Transitions to Slides in MS PowerPoint
- Layout and Views in Presentation Tool
- Formatting Text on a Slide in a PPT using Java
- How to Record Screen using Microsoft PowerPoint?
Creating and updating PowerPoint Presentations in Python using python – pptx
python-pptx is library used to create/edit a PowerPoint (.pptx) files. This won’t work on MS office 2003 and previous versions. We can add shapes, paragraphs, texts and slides and much more thing using this library.
Installation: Open the command prompt on your system and write given below command:
Let’s see some of its usage:
Example 1: Creating new PowerPoint file with title and subtitle slide.
Example 2: Adding Text-Box in PowerPoint.
Example 3: PowerPoint (.pptx) file to Text (.txt) file conversion.
Example 4: Inserting image into the PowerPoint file.
Example 5: Adding Charts to the PowerPoint file.
Example 6: Adding tables to the PowerPoint file.
Please Login to comment...
Similar reads.
- python-modules
- python-utility
Improve your Coding Skills with Practice
What kind of Experience do you want to share?
Create interactive slides with Python in 8 Jupyter Notebook cells
Creating presentations in Jupyter Notebook is a great alternative to manually updating slides in other presentation creation software. If your data changes, you just re-execute the cell and slide chart is updated.
Jupyter Notebook is using Reveal.js (opens in a new tab) for creating slides from cells. The standard approach is to write slides code and Markdown in the Jupyter Notebook. When notebook is ready, it can be exported to standalone HTML file with presentation.
What if, you would like to update slides during the slide show? What is more, it would be fantastic to have interactive widgets in the presentation. You can do this in Mercury framework.
In this tutorial, we will create an interactive presentation in Jupyter Notebook and serve it with Mercury.
Create presentation in notebook
Please enable Slideshow toolbar in Jupyter Notebook. It can be done by clicking View -> Cell Toolbar -> Slideshow . It is presented in the screenshot below:
We will need following packages to create presentation in Python notebook:
Please make sure that they are installed in your environment.
1. Import packages and App setup
The first step is to import packages and setup Mercury App :
We setup title and description for App object.
Please note that we set Slide Type to Skip . This cell will not appear in the presentation.
2. Add title
The second cell is a Markdown with title:
The Slide Type is set to Slide . It is our first slide!
3. Add slide with Markdown
Add new Markdown cell with the following cell.
Please set Slide Type to Slide . It will be a second slide. I'm using ## as slide title ( # will produce too large title in my opinion).
4. Add Mercury Widget
Please add code cell with Text widget. We will use it, to ask users about their name.
We set Slide Type as Skip , so this cell will not appear in the presentation.
5. Display name
Let's use the name.value in the slide. Please add a code cell. We will display a Markdown text with Python variables by using Markdown function from Mercury package.
Please set the Slide Type to Slide .
You can display Markdown with Python variables by calling mr.Markdown() or mr.Md() functions. Both do the same.
The first five cells of the notebook:
You can enter your name in the widget during the notebook development. There will be no change in other cells. If you want to update the cell with new widget value, please execute it manually.
6. More widgets
We can add more widgets to the presentation. They will be used to control chart in the next slide.
We have used Slider and Select widgets. They are displayed in the notebook. This cell will not be displayed in the presentation, so set Slide Type to Skip .
7. Scatter plot
We will add a new code cell. It will have Slide Type set to Slide .
We used widgets values by accessing them with samples.value and color.value .
Screenshot of the notebook with scatter plot:
8. Final slide
Please add a last Markdown cell. Its Slide Type will be set to Slide :
Please notice that link is added with HTML syntax. There is a target="_blank" used to open link in a new tab.
Run presentation in Mercury
Please run Mercury local server in the same directory as notebook:
The above command will open a web browser at http://127.0.0.1:8000 . Please click on a card with presentation.
You can navigate between slides with arrows in the bottom right corner. You can enter the full screen mode by pressing F on the keyboard. Please use Esc to exit full screen mode.
You can change widgets values in the sidebar and presentation slides will be automatically recomputed:
You can export your slides as PDF or HTML by clicking Download button in the sidebar.
Fatal Python error: init_fs_encoding. Fresh Install, Win11, no venv
I am running on Windows 11 with no virtual environment and a fresh installation, but no matter what I do, I’ve been plagued with this error.
Any help would be greatly appreciated, thanks in advance!
Your installation’s config is in a severely broken state. How did you install this python? Did you try removing (potentially manually) and reinstalling?
I installed through windows store, installed via the download on the website, read that’s a problem, uninstalled both, and reinstalled the website version.
Do I need to do something other than uninstall?
That should be enough, but clearly isn’t. I don’t know where python tries to get it’s config values from, someone else might be able to help you better there.
Although, one more question: How are you running python?
It is intended to run code, but it also isn’t working whenever I try to run “python” or “py” in either powershell or command line, it doesn’t work
Hm, I don’t really know how to help you here. I would suggest you open up an issue on the proper bug tracker which as much information as possible. There is this issue which encounters the same error message, however that is quite a different situation since it isn’t using the normal installers.
Okay, I still appreciate your insight. I was able to get a previous version of python working, but yeah the problem is persistent on the newest version of python
This error seems to come up quite often (well - rare compared to the total number of installations, but often enough to create traffic here and on Stack Overflow), but I’ve yet to see a reproducible example, or an analysis of exactly how such installations (are | become) broken.
All other examples I have seen from a quick search either involve PYTHONHOME being set to something (not the case here as can be seen from the posted output) or a manually build python (which isn’t the case unless we assume OP is lying), and OP says that a reinstall didn’t solve anything - Do you have further suggestions for what to purge? I don’t exactly want to suggest messing around in the registry, especially because I am not aware of any keys there that could lead to this.
I’m afraid not. But if OP’s described sequence of events consistently reproduces the problem - for reference:
- install some Windows Store version of Python (which one?)
- install an official python.org version (which one? maybe this is specific to certain combinations; or happens if they’re the same version; or happens if they’re different versions; or…)
- uninstall both (in which order? does it matter?)
- reinstall the same python.org version and attempt to use it
…and nothing else is needed, that seems like a major clue (and a reason for the dev team to talk to Microsoft again).
For what it’s worth, this seems to be the relevant documentation:
And to highlight the important parts from OP’s error dump:
Python needs to import the encodings standard library module at startup to bootstrap itself, but it doesn’t appear to be found in any of those paths in sys.path . I think this set of paths looks subtly wrong, but I don’t have easy access to Windows to check what it would normally default to.
Karl, I’m going to try to replicate this. The crux of the problem is that the startup initialization is mistakenly setting sys.prefix to “C:\Users\jsgrazzutti”. Off the top of my head, I don’t know why that would happen since PYTHONHOME isn’t set.
My first attempt didn’t reproduce the problem. Starting fresh with no 3.12 installation on disk or in the registry, or any remnant of a past installation, I installed the store version of 3.12, followed by a current-user installation of 64-bit 3.12. I then removed them both and reinstalled 3.12 for the current user. There was no issue, other than the fact that uninstalling isn’t as clean as I’d like. (It leaves behind the installation directory and some registry entries, but nothing that should be a problem.)
I was able to reproduce this partly by renaming the standard library landmark “Lib\os.py” to “Lib\os.bak”, which emulates that the landmark file is missing. This causes the warning to be printed “Could not find platform independent libraries <prefix>”. In this case, sys.prefix gets set to the current working directory, which happens to be %USERPROFILE% in the given case. However, there should still be a default sys.path stored in the registry key “HKCU\Software\Python\PythonCore\3.12\PythonPath”. If for some reason that’s not available, then a hard-coded default sys.path is used, which is resolved relative to the incorrect sys.prefix , and recreates the issue exactly.
I suggest the following steps:
- Uninstall Python 3.12.
- Manually delete the installation directory “%LocalAppData%\Programs\Python\Python312”, if it exists.
- Manually delete the registry key “HKCU\Software\Python\PythonCore\3.12”, if it exists.
- Install Python 3.12 for the current user.
- Verify the existence of the file “%LocalAppData%\Programs\Python\Python312\Lib\os.py”.
- Verify the existence of the registry key “HKCU\Software\Python\PythonCore\3.12\PythonPath”.
Related Topics
Installing scikit-learn #
There are different ways to install scikit-learn:
Install the latest official release . This is the best approach for most users. It will provide a stable version and pre-built packages are available for most platforms.
Install the version of scikit-learn provided by your operating system or Python distribution . This is a quick option for those who have operating systems or Python distributions that distribute scikit-learn. It might not provide the latest release version.
Building the package from source . This is best for users who want the latest-and-greatest features and aren’t afraid of running brand-new code. This is also needed for users who wish to contribute to the project.
Installing the latest release #
Install the 64-bit version of Python 3, for instance from the official website .
Now create a virtual environment (venv) and install scikit-learn. Note that the virtual environment is optional but strongly recommended, in order to avoid potential conflicts with other packages.
In order to check your installation, you can use:
Install Python 3 using homebrew ( brew install python ) or by manually installing the package from the official website .
Now create a virtual environment (venv) and install scikit-learn. Note that the virtual environment is optional but strongly recommended, in order to avoid potential conflicts with other packges.
Python 3 is usually installed by default on most Linux distributions. To check if you have it installed, try:
If you don’t have Python 3 installed, please install python3 and python3-pip from your distribution’s package manager.
Install conda using the Anaconda or miniconda installers or the miniforge installers (no administrator permission required for any of those). Then run:
Using an isolated environment such as pip venv or conda makes it possible to install a specific version of scikit-learn with pip or conda and its dependencies independently of any previously installed Python packages. In particular under Linux it is discouraged to install pip packages alongside the packages managed by the package manager of the distribution (apt, dnf, pacman…).
Note that you should always remember to activate the environment of your choice prior to running any Python command whenever you start a new terminal session.
If you have not installed NumPy or SciPy yet, you can also install these using conda or pip. When using pip, please ensure that binary wheels are used, and NumPy and SciPy are not recompiled from source, which can happen when using particular configurations of operating system and hardware (such as Linux on a Raspberry Pi).
Scikit-learn plotting capabilities (i.e., functions starting with plot_ and classes ending with Display ) require Matplotlib. The examples require Matplotlib and some examples require scikit-image, pandas, or seaborn. The minimum version of scikit-learn dependencies are listed below along with its purpose.
Scikit-learn 0.20 was the last version to support Python 2.7 and Python 3.4. Scikit-learn 0.21 supported Python 3.5-3.7. Scikit-learn 0.22 supported Python 3.5-3.8. Scikit-learn 0.23-0.24 required Python 3.6 or newer. Scikit-learn 1.0 supported Python 3.7-3.10. Scikit-learn 1.1, 1.2 and 1.3 support Python 3.8-3.12 Scikit-learn 1.4 requires Python 3.9 or newer.
Third party distributions of scikit-learn #
Some third-party distributions provide versions of scikit-learn integrated with their package-management systems.
These can make installation and upgrading much easier for users since the integration includes the ability to automatically install dependencies (numpy, scipy) that scikit-learn requires.
The following is an incomplete list of OS and python distributions that provide their own version of scikit-learn.
Alpine Linux #
Alpine Linux’s package is provided through the official repositories as py3-scikit-learn for Python. It can be installed by typing the following command:
Arch Linux #
Arch Linux’s package is provided through the official repositories as python-scikit-learn for Python. It can be installed by typing the following command:
Debian/Ubuntu #
The Debian/Ubuntu package is split in three different packages called python3-sklearn (python modules), python3-sklearn-lib (low-level implementations and bindings), python3-sklearn-doc (documentation). Note that scikit-learn requires Python 3, hence the need to use the python3- suffixed package names. Packages can be installed using apt-get :
The Fedora package is called python3-scikit-learn for the python 3 version, the only one available in Fedora. It can be installed using dnf :
scikit-learn is available via pkgsrc-wip : https://pkgsrc.se/math/py-scikit-learn
MacPorts for Mac OSX #
The MacPorts package is named py<XY>-scikits-learn , where XY denotes the Python version. It can be installed by typing the following command:
Anaconda and Enthought Deployment Manager for all supported platforms #
Anaconda and Enthought Deployment Manager both ship with scikit-learn in addition to a large set of scientific python library for Windows, Mac OSX and Linux.
Anaconda offers scikit-learn as part of its free distribution.
Intel Extension for Scikit-learn #
Intel maintains an optimized x86_64 package, available in PyPI (via pip ), and in the main , conda-forge and intel conda channels:
This package has an Intel optimized version of many estimators. Whenever an alternative implementation doesn’t exist, scikit-learn implementation is used as a fallback. Those optimized solvers come from the oneDAL C++ library and are optimized for the x86_64 architecture, and are optimized for multi-core Intel CPUs.
Note that those solvers are not enabled by default, please refer to the scikit-learn-intelex documentation for more details on usage scenarios. Direct export example:
Compatibility with the standard scikit-learn solvers is checked by running the full scikit-learn test suite via automated continuous integration as reported on intel/scikit-learn-intelex . If you observe any issue with scikit-learn-intelex , please report the issue on their issue tracker .
WinPython for Windows #
The WinPython project distributes scikit-learn as an additional plugin.
Troubleshooting #
If you encounter unexpected failures when installing scikit-learn, you may submit an issue to the issue tracker . Before that, please also make sure to check the following common issues.
Error caused by file path length limit on Windows #
It can happen that pip fails to install packages when reaching the default path size limit of Windows if Python is installed in a nested location such as the AppData folder structure under the user home directory, for instance:
In this case it is possible to lift that limit in the Windows registry by using the regedit tool:
Type “regedit” in the Windows start menu to launch regedit .
Go to the Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem key.
Edit the value of the LongPathsEnabled property of that key and set it to 1.
Reinstall scikit-learn (ignoring the previous broken installation):
Navigation Menu
Search code, repositories, users, issues, pull requests..., provide feedback.
We read every piece of feedback, and take your input very seriously.
Saved searches
Use saved searches to filter your results more quickly.
To see all available qualifiers, see our documentation .
- Notifications You must be signed in to change notification settings
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] 安装依赖报错 #2054
yueyann commented Nov 14, 2023
maxusheng123 commented Nov 15, 2023
Sorry, something went wrong.
yueyann commented Nov 15, 2023
fqdltd commented Nov 16, 2023
zRzRzRzRzRzRzR commented Nov 16, 2023
woshahua commented Nov 17, 2023
Woshahua commented nov 18, 2023.
- 👍 4 reactions
fanlun008 commented Mar 6, 2024
No branches or pull requests
How to use your GPU in Jupyter Notebook
I f you’re unfamiliar with it, Jupyter Notebook is a powerful IDE that lets you create scripts for data analysis, web scraping, machine learning, and tons of other use cases. For the average coder who's into data science, Jupyter Notebook serves as the perfect companion as it lets you create interactive documents for everything from jotting down notes to compiling complex codes. While this IDE can be installed on pretty much any modern laptop , you're going to have a tough time if you try to train AI algorithms on a CPU.
As such, you can configure Jupyter Notebook to relegate the demanding deep-learning workloads to your powerful graphics card instead of the processor. However, you'll have to go through several steps, including setting up Python libraries, creating coding environments, and installing drivers before you can run Jupyter Notebook on your graphics card.
How to use Jupyter Notebook on Windows, Linux, and macOS
Installing python.
This step may sound redundant if you’re already knee-deep into programming, but you’ll need to install Python on your PC to use GPU-accelerated AI in Jupyter Notebook. Simply download the Python.exe file from the official website and click on the install button after granting admin privileges to the installer.
How to install Python on Windows, Linux, and macOS
For most users, I recommend choosing the Disable Path Length Limit to avoid future headaches caused by the 260-character limit on the length of file paths set by Windows 11 .
Installing Miniconda
Miniconda is a toolkit that contains important Python libraries, environments, and packages necessary to enable your GPU. It also lets you create a Jupyter Notebook.
- Download the setup.exe file from the official website and run it with admin privileges.
- Choose the I Agree option when the installer asks you to agree to the licensing terms and hit Next .
- Choose the directory where you wish to install Miniconda, and click on the Next button.
- Hit the Install button and press Finish once the installation is complete.
Setting up a Conda environment
Now that you’ve installed Python and Miniconda, it’s time to configure a coding environment for your machine learning projects. I recommend creating a separate enviroment as we'll be using older packages in this tutorial.
Since the latest version of TensorFlow doesn’t work on Windows 11 systems that don't have WSL pre-configured, you’ll have to install a build that’s older than TensorFlow v2.11. The same goes for Python, so you’ll have to downgrade to Python 3.9 in the new Conda environment.
- Type miniconda in the Windows Search Bar and pick the Run as Administrator option under the Anaconda Powershell Prompt .
- Paste the following code into the terminal and press enter: conda create --name my_env python=3.9 -y
- Activate the newly created environment using the following command: conda activate my_env
- Run this command to install the cuDNN library and CUDA drivers: conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0 -y
- Install the TensorFlow library by running the following command: pip install "tensorflow<2.11"
Installing Jupyter Notebook
Finally, you can set up a local Jupyter Notebook server containing all your project files.
- Run this code inside the Anaconda Powershell Prompt : pip install jupyter notebook -y
- Open the Jupyter Notebook server by typing: jupyter notebook
You can check if the Miniconda coding environment works with the GPU. To do so,
- Click on the New button and choose Notebook .
- Select Python 3 (ipykernel) as the kernel.
- import tensorflow as tf
- gpus = tf.config.list_physical_devices("GPU")
- for gpu in gpus:
- print("Found a GPU with the name:", gpu)
- print("Failed to detect a GPU.")
- Press the Run button.
If Jupyter Notebook displays a graphics card as the output, it means the process was successful!
Running Jupyter Notebook on a GPU
Once you’ve verified that the graphics card works with Jupyter Notebook, you can use the import tensorflow code snippet to leverage your GPU in all your machine-learning projects. In case Jupyter Notebook is unable to detect your graphics card, you can retry the same procedure in another Conda environment. Be sure to install the same versions of the CUDA drivers and the cuDNN and TensorFlow libraries as I've used in this tutorial to avoid running into compatibility issues.
If your projects take eons to compile, your graphics card could be lacking in horsepower. Upgrading to a better GPU is an easy fix that will give your PC the much-needed boost to run complex AI and deep learning algorithms.
Best GPUs for deep learning in 2024
- This tutorial requires access to Oracle Cloud. To sign up for a free account, see Get started with Oracle Cloud Infrastructure Free Tier .
- It uses example values for Oracle Cloud Infrastructure credentials, tenancy, and compartments. When completing your lab, substitute these values with ones specific to your cloud environment.
Install and Configure Pulumi Infrastructure as Code tool on Oracle Cloud Infrastructure
Introduction
Let us simplify your Oracle Cloud infrastructure (OCI) management with the Pulumi Infrastructure as Code (IaC) tool. This tutorial will discuss how to install and set up Pulumi, ensuring it seamlessly fits into your workflow. Whether you are experienced or getting started with IaC, this tutorial has step-by-step instructions. Get ready to upgrade your infrastructure management with Pulumi on OCI.
Once Pulumi is running on your OCI set up, you will see a noticeable improvement in efficiency. The straightforward interface makes resource deployment and management easy and simplifies your OCI infrastructure management.
- Install and configure the Pulumi IaC tool on OCI for deployment and management.
Prerequisites
Access to an OCI tenancy.
A user account with the privileges to access OCI services and resources.
Task 1: Download and Install Pulumi
Download and install Pulumi on your system or virtual machine (VM). For more information, see Download & install Pulumi .
For example, macOS users can install Pulumi by running the following command.
Task 2: Install the OCI Provider Package for Pulumi
OCI providers act as the connection between Pulumi code and the OCI services you aim to oversee. OCI providers enable Pulumi to create, manage, and configure resources within your OCI environment through code.
To install the OCI providers for Pulumi, go to the Command Line Interface (CLI) and run the installation command. For this tutorial, we will use Python as the Pulumi language for deploying OCI services.
To install OCI providers using other languages, see OCI provider for Pulumi .
Task 3: Configure Environment Variables
Set up the necessary environment variables to connect Pulumi with your OCI environment. These variables include your tenancy Oracle Cloud Identifier (OCID), user OCID, fingerprint, region, and the path to your OCI API key.
Modify the values as per your tenancy config file and run the following commands.
Task 4: Create a Pulumi Stack
Organize your project by creating a directory for your Pulumi stack. Initialize it with your preferred programming language. For this tutorial, we are using Python stack.
Create a Pulumi stack directory. To create a new directory for your Pulumi stack, run the following command.
Initialize the Pulumi project project with an OCI Python template: pulumi new oci-python .
Enter the project details like project name, description, and stack name (for example, dev, staging, prod). This step starts the set up process, including adding necessary dependencies and loading sample code into the main.py file.
Verify the code set up by checking the contents of the OCI_Pulumi_Stack directory. This is where you will find the sample code and any additional files created during the initialization process.
Task 5: Customize a Pulumi Stack
Customize a stack according to your specific requirements. Open the main deployment file main.py and add the necessary code to define the OCI resources you want to deploy. In this tutorial, we will show you how to retrieve the availability domains within your OCI tenancy.
This code demonstrates how to fetch the availability domains from your OCI tenancy and export their names as output. When you execute this code using Pulumi, it will interact with OCI to retrieve the availability domains and display their names as output. This allows you to ensure that your code accurately retrieves the necessary information from OCI.
Task 6: Deploy the Pulumi Code to OCI
Run the following command to deploy resources to OCI.
Task 7: Verify the Command Output
After deployment, command will run the Pulumi program and retrieve the availability domains within your OCI tenancy, as defined in the code.
Related Links
- Overview of OCI provider for Pulumi
Acknowledgments
- Authors - Akarsha I K (Cloud Architect), Maninder Flora (Cloud Architect)
More Learning Resources
Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel . Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.
For product documentation, visit Oracle Help Center .
IMAGES
VIDEO
COMMENTS
Project description. python-pptx is a Python library for creating, reading, and updating PowerPoint (.pptx) files. A typical use would be generating a PowerPoint presentation from dynamic content such as a database query, analytics output, or a JSON payload, perhaps in response to an HTTP request and downloading the generated PPTX file in ...
python-pptx depends on the lxml package and Pillow, the modern version of the Python Imaging Library (PIL).The charting features depend on XlsxWriter.Both pip and easy_install will take care of satisfying these dependencies for you, but if you use the setup.py installation method you will need to install the dependencies yourself.. Currently python-pptx requires Python 2.7 or 3.3 or later.
from pptx import Presentation prs = Presentation (path_to_presentation) # text_runs will be populated with a list of strings, # one for each text run in presentation text_runs = [] for slide in prs. slides: for shape in slide. shapes: if not shape. has_text_frame: continue for paragraph in shape. text_frame. paragraphs: for run in paragraph ...
python-pptx¶. Release v0.6.22 (Installation)python-pptx is a Python library for creating, reading, and updating PowerPoint (.pptx) files.. A typical use would be generating a PowerPoint presentation from dynamic content such as a database query, analytics output, or a JSON payload, perhaps in response to an HTTP request and downloading the generated PPTX file in response.
python-pptx is a Python library for creating and updating PowerPoint files. This article is going to be a basic introduction to this package. If you want to learn much more about it, this is the official documentation page that you should check. Now let's install the package if you don't have. pip install python-pptx.
Step 3 - Generate PowerPoint Slides. Navigate to the directory containing the script in your terminal and run the following command: $ python3 create_ppt.py. This command will execute the script, and generate a new PowerPoint file named " Linux_Security_Presentation.pptx " in the same directory.
pip install python-pptx. Let's see some of its usage: Example 1: Creating new PowerPoint file with title and subtitle slide. Python3. from pptx import Presentation . root = Presentation() first_slide_layout = root.slide_layouts[0] . 0 -> title and subtitle. 5 -> Title only .
The Basic Structure of python-pptx. After installing the package, using python-pptx is the same as any other library. At the top of the file, import the dependencies you will need: Besides the ...
II. Process Data and Design Slides with Python. You can find the source code with dummy data here: Github. Let us explore all the steps to generate your final report. Steps to create your operational report on PowerPoint — (Image by Author) 1. Data Extraction. Connect to your WMS and extract shipment records.
Spire.Presentation for Python is a powerful API for processing presentations and is highly compatible with PowerPoint®. It enables efficient creation, editing, conversion, and saving of PowerPoint® presentations in any Python program. - eiceblue/Spire.Presentation-for-Python
from pptx import Presentation. This is my error: ModuleNotFoundError: No module named 'pptx'. I have downloaded python-pptx using pip: sudo pip install python-pptx. Running pip show python-pptx in the Terminal, I get: Name: python-pptx. Version: 0.6.16. Summary: Generate and manipulate Open XML PowerPoint (.pptx) files.
It is simple as any other python lib to install and use. If you are using any IDE that will be better as it will suggest the building function and variables. Install: pip install python-pptx. I suggest you use the pip install code line because this package depends on Ixml, Pillow and XlsxWriter packages. If you use the setup.py installation ...
Below are the six steps to present your python code using RISE. Write the python code/logic for the presentation. Install Python — later the better. Install Jupyter Notebook using the command prompt. Install RISE from the command prompt. After installing, open the Jupyter Notebook and check for the RISE button on the toggle bar.
The so-called "default template" is actually just a PowerPoint file that doesn't have any slides in it, stored with the installed python-pptx package. It's the same as what you would get if you created a new presentation from a fresh PowerPoint install, a 4x3 aspect ratio presentation based on the "White" template.
Create interactive slides with Python in 8 Jupyter Notebook cells. Creating presentations in Jupyter Notebook is a great alternative to manually updating slides in other presentation creation software. If your data changes, you just re-execute the cell and slide chart is updated.
Step 1: Download the Official Installer. Follow these steps to download the full installer: Open a browser window and navigate to the Python.org Downloads page for macOS. Under the "Python Releases for Mac OS X" heading, click the link for the Latest Python 3 Release - Python 3.x.x.
My first attempt didn't reproduce the problem. Starting fresh with no 3.12 installation on disk or in the registry, or any remnant of a past installation, I installed the store version of 3.12, followed by a current-user installation of 64-bit 3.12. I then removed them both and reinstalled 3.12 for the current user.
Installing scikit-learn# There are different ways to install scikit-learn: Install the latest official release. This is the best approach for most users. It will provide a stable version and pre-built packages are available for most platforms. Install the version of scikit-learn provided by your operating system or Python distribution. This is ...
This section provides end-to-end instructions from installing the OML4Py client to downloading a pretrained embedding model in ONNX-format using the Python utility package offered by Oracle. These instructions assume you have configured your Oracle Linux 8 repo in /etc/yum.repos.d, configured a Wallet if using an Autonomous Database, and set up ...
The simplest way to install setuptools when it isn't already there and you can't use a package manager is to download ez_setup.py and run it with the appropriate Python interpreter. This works even if you have multiple versions of Python around: just run ez_setup.py once with each Python.
A pivot table is a data analysis tool that allows you to take columns of raw data from a pandas DataFrame, summarize them, and then analyze the summary data to reveal its insights.. Pivot tables allow you to perform common aggregate statistical calculations such as sums, counts, averages, and so on. Often, the information a pivot table produces reveals trends and other observations your ...
Introduction. ¶. python-pptx is a Python library for creating and updating PowerPoint (.pptx) files. A typical use would be generating a customized PowerPoint presentation from database content, downloadble by clicking a link in a web application. Several developers have used it to automate production of presentation-ready engineering status ...
执行 pip install -r requirements_api.txt. 问题出现 / Problem occurs. 预期的结果 / Expected Result 描述应该出现的结果 / Describe the expected result. 实际结果 / Actual Result Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Ignoring python-magic-bin: markers 'sys_platform == "win32"' don't match your environment
How to install Python on Windows, Linux, and macOS If you want to install Python and get started with development, we have a handy quick-start guide to run you through the basics.
As a first step to interact with the database, we should establish a connection with the database. To connect to a sample database example.db, you can use the connect() function from the sqlite3 module like so: conn = sqlite3.connect('example.db') If the database already exists, then it connects to it. Else it creates the database in the ...
Create a Pulumi stack directory. To create a new directory for your Pulumi stack, run the following command. mkdir OCI_Pulumi_Stack &&cd OCI_Pulumi_Stack. Initialize the Pulumi project project with an OCI Python template: pulumi new oci-python. Enter the project details like project name, description, and stack name (for example, dev, staging ...