Jump to content
JohnLM

How do I "Import" Libraries using Python4Delphi?

Recommended Posts

Specs: Delphi XE7, VCL, Win7 64Bit - current version of Python v2.7.9rc1 as of today 2/1/2025 Friday -- edit: will update it to latest for win7, to v3.8.10

 

As part of my learning of Python and using Python4Delphi as the learning real-time GUI tool, I came across a youtube tutorial video where the person was calling the following Import libraries: 

import pandas as pd
import matplotlib.pyplot as plt
import networkx as nx

In other learning python projects I have imported some libraries successfully.   The ones above are not avail on my laptop.  So I am guessing that I have to download them. 

 

1. Where can I download them from?

2. and where (hdd folder) do I download them to on my laptop?

 

Please note: that I am not using any official Python IDE GUI app.  I am using Python4Delphi and building a small IDE for it and am using that as the IDE GUI app to run python code and/or test and run python lessons with. 

 

Edited by JohnLM
added my system/work specs

Share this post


Link to post

pip is not on my machine.  I searched around for it.  Also, after some time searching some more, I found out how to tell which version of Python I have installed, which is currently at version 2.7.9rc1 and I must have installed it back in 2014 since the date of the folder "Python27" shows that year it was created.   To the best of my memory, I got interested in it when I heard about and watched a youtube video on Python4Delphi by Jim Mckeeth and I must have installed to try it out back then and then forgot about it until around now.  But the version I have seems to work fine, and I've tried many lessons successfully. Just basic stuff.  But now I want to get into it more deeper. 

 

Oh, and I searched around for "pandas" or a folder at least, and I did not find any.  It looks like I have a bit of research to do. 
 

Edited by JohnLM
typos

Share this post


Link to post

Just go to www.python.org, download the most recent version and install it.  It includes pip.

Share this post


Link to post

Thanks.  Okay, I found the last version of Python being made for Windows 7 is v3.8.10 - After that version, only Windows 10 and onward - 😞

 

link --> https://www.python.org/downloads/release/python-3810/

download link 64b --> https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe

download link 32b --> https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe 

Share this post


Link to post

Apparently, I did have v3.8.10 installed, but the installation must have missed some things I did not tick at the time of initial installation.

 

I proceeded to uninstall it and reinstall it and making sure I tic the part about adding it the search path. 

 

Afterwards, the installation went successfully and I type in PIP and the process worked.   

 

Below is a run-through of the process for the command line: PIP install pandas

 

C:\Users\dell>pip install pandas
Collecting pandas
  Downloading pandas-2.0.3-cp38-cp38-win_amd64.whl (10.8 MB)
     |████████████████████████████████| 10.8 MB 1.3 MB/s
Collecting python-dateutil>=2.8.2
  Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
     |████████████████████████████████| 229 kB 1.7 MB/s
Collecting numpy>=1.20.3
  Downloading numpy-1.24.4-cp38-cp38-win_amd64.whl (14.9 MB)
     |████████████████████████████████| 14.9 MB 1.6 MB/s
Collecting pytz>=2020.1
  Downloading pytz-2025.1-py2.py3-none-any.whl (507 kB)
     |████████████████████████████████| 507 kB 1.3 MB/s
Collecting tzdata>=2022.1
  Downloading tzdata-2025.1-py2.py3-none-any.whl (346 kB)
     |████████████████████████████████| 346 kB 1.3 MB/s
Collecting six>=1.5
  Downloading six-1.17.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, tzdata, pytz, python-dateutil, numpy, pandas

Successfully installed numpy-1.24.4 pandas-2.0.3 python-dateutil-2.9.0.post0 pyt
z-2025.1 six-1.17.0 tzdata-2025.1
WARNING: You are using pip version 21.1.1; however, version 25.0 is available.
You should consider upgrading via the 'c:\users\dell\appdata\local\programs\pyth
on\python38\python.exe -m pip install --upgrade pip' command.

C:\Users\dell>

I am not sure that it installed in the correct place.  I mean, I did not give it a folder/path name.  I just opened a comand line prompt via CMD and the default folder showed, thus, c:\users\dell

 

I am not a Python guru.  Can anybody confirm that I performed this operation correctly?  

 

Edited by JohnLM
typos

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×