Hi Jon,
Nice to get in touch with you again.
With your help, I see that there is no 'openpyxl' folder in the C:\Program Files\IBM\SPSS\Statistics\26\Python3\Lib\site-packages, but when I try 'pip install openpyxl' command in this location, I am getting the following error. When try 'pip install imp', still getting same error, so any idea?
C:\Program Files\IBM\SPSS\Statistics\26\Python3\Lib\site-packages>pip install openpyxl
Traceback (most recent call last):
File "<frozen runpy>", line 189, in _run_module_as_main
File "<frozen runpy>", line 148, in _get_module_details
File "<frozen runpy>", line 112, in _get_module_details
File "C:\Program Files\IBM\SPSS\Statistics\26\Python3\Lib\site-packages\pip\__init__.py", line 13, in <module>
from pip.utils import get_installed_distributions, get_prog
File "C:\Program Files\IBM\SPSS\Statistics\26\Python3\Lib\site-packages\pip\utils\__init__.py", line 17, in <module>
from pip.compat import console_to_str, stdlib_pkgs
File "C:\Program Files\IBM\SPSS\Statistics\26\Python3\Lib\site-packages\pip\compat\__init__.py", line 6, in <module>
import imp
ModuleNotFoundError: No module named 'imp'
Re using STATS INSTALL PACKAGES, somehow the Extension hub window is not opening for me. When clicked, the window appears very briefly then disappears.
With thanks,
Zula
Original Message:
Sent: 12/19/2023 2:08:00 PM
From: Jon Peck
Subject: RE: pip3 install openpyxl
Check the path locations set for Python in that version.
begin program python3.
import sys
print(sys.path)
end program.
oprnpyxl should be in one of those locations, or at least the openpyxl directory.
You might try installing it via the STATS INSTALL PACKAGES extension command, which should ensure that it is in a location where SPSS Statistics will use.
STATS INSTALL PACKAGES can be installed via Extensions > Extension Hub if you don't already have it.
--
Original Message:
Sent: 12/19/2023 1:09:00 PM
From: Munkhzul Zookhuu
Subject: pip3 install openpyxl
Hi,
I am trying to use openpyxl with SPSS 26. It looks like the openpyxl is installed on the Python 3.4 which is installed with SPSS. The code I am running from SPSS is the following.
begin program python3.
import openpyxl
end program.
But getting the following error.
Traceback (most recent call last):
File "<string>", line 2, in <module>
ImportError: No module named 'openpyxl'
Can anyone please help me with it?
With thanks,
Zula
------------------------------
Zula
------------------------------