I recently had my work computer changed due to IT policy and had to reinstall my Python environment. My work computer is Policy controlled so I cannot install Python from the official Python.org installers, rather I have to install Python from the packages in my company's software repository, and they don't allow Python 3.12.
The Python installation went off without a hitch, and my Python interpreter is installed in C:/Users/609049066/AppData/Local/Microsoft/WindowsApps/python3.11.exe. For running my code I had written in a previous machine, I needed pandas, so I used command pip install pandas to install the package. The package installation also went off without a hitch. The packages were installed in C:\Users\609049066\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages.
In my code, the first line is import pandas as pd. As soon as the Python interpreter executes this, I get the below error and my code execution stops.
Traceback (most recent call last):
File "c:\Soumik Work\Code\GenesysCloudRoutingObjectsToolkit\get_All_Divisions_v1.py", line 2, in <module>
import pandas as pd
File "C:\Users\609049066\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pandas\__init__.py", line 32, in <module>
raise ImportError(
ImportError: Unable to import required dependencies:
numpy: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
Soumik
I have been looking at other forum posts and none of them help. I have the constraint that I cannot install Python 3.12.4 from Python.org as this is restricted on my work computer. I have added the location of the Scripts folder (C:\Users\609049066\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts) in the Windows Environment variables and rebooted my machine to no avail.
On my previous computer, the exact same code used to run fine with zero errors. My previous work computer used Python 3.10 and was Windows 10, whereas my new machine is Windows 11. I have tried uninstalling Python 3.11 as well as pandas package, installing Python 3.10 on my new machine and trying with the pandas package, but the error persists.
Can anyone suggest what am I doing wrong?
Soumik