#๐ error preventing pandas/numpy from working
231 messages ยท Page 1 of 1 (latest)
@honest anchor
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
ImportError: Unable to import required dependencies:
numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
The following compiled module files exist, but seem incompatible
with with either python 'cpython-313' or the platform 'win32':
- _multiarray_umath.cp313-win_amd64.lib
- _multiarray_umath.cp313-win_amd64.pyd
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
- The Python version is: Python 3.13 from "C:\python\python3.13t.exe"
- The NumPy version is: "2.4.0"
and make sure that they are the versions you expect.
Please carefully study the information and documentation linked above.
This is unlikely to be a NumPy issue but will be caused by a bad install
or environment on your machine.
Original error was: No module named 'numpy._core._multiarray_umath'
I think the problem has somethign to do with it looking for a win32 platform and only finding win_amd64
but I dont' know enough about PATH/how these things actually work to know for sure
What I've done so far:
uninstalled/reinstalled pandas & numpy
double checked previously working code
checked python verions/path (I think its set up correctly?)
have you actually installed numpy into your python environment?
using pip install?
or is there a different way?
(I've used packages pretty regularly in the past and I've never had do to anything past pip install)
pip should work
I think I just checked the version I'm using
have you verified that the python environment you are using to run the code is the same one that you installed numpy into?
well you just verified that the python that runs from your terminal has numpy installed
what is the actual stack trace you get?
Are you running the code from the terminal as well or from within Pycharm?
the picture I shared is the only output
just from within VScode
what happens if you run it from the terminal?
good question
I tried the python3 command and it opened a microsoft store page to download python?
what if you run python --version from the cmd line?
3.13.7
python usually gets mapped for you as an alias to python3 so you don't normally have to use python3
so just type python <name of python file>
no such file or directory
also, your working dir should be the project root. If the file is nested you need to give the relative path from that root
ls didn't pull up the files in the directory?
or is that bash and not command prompt?
well it looks like you're in a simple windows terminal
thats why I'm asking if ls is not a command that works
send me a screenshot of your project files and how they are organized, make sure to expand nested folders from the project root to the .py file you are trying to run
(I've taken an intro class to understanding how computers actually work and all of my other knowledge is self taught how to use python)
I don't use windows so I'm not really familiar with the windows terminal commands. I think it's pwd or just dir maybe to see the current directory. Maybe list or lst for listing files? I'm just guessing though
What's the panel to the left that's cut off?
Aren't you running it from inside VSCode?
yes
I'm runnign the code from vs code
I'm sending you screenshots of my file explorer
What is the project root, and what is the structure from that root to the file you are trying to run?
PycharmProjects is the root
show me the screenshot from VSCode
getting warmer
keep going until the file you are trying to run is also shown
You're using VSCode with a PyCharm project?
I downloaded pycharm to try it out and decided I preferred VScode
also tried this .py file
Is the whole app in just one .py file?
and I've run deed_import.py in the past an not had any problems
yup
imports the xlsx above and returns the column names I think?
And we're looking at a panel from VSCode right?
yes
ok so from the terminal navigate to that d602... directory then type python <file name>
so that means numpy is correctly installed in this python env. Are you sure you're using the same environment in VSCode?
VSCode has some settings where for your project it's using a particular version of Python. Can you verify that this version is the same version your terminal is using? In the terminal type where python
The error means that for some reason you're using 32-bit python here. Have you checked your python version?
Maybe the vsc you have is 32-bit and therefore can't properly run python?
@worldly orchid
Did that get cut off? What's the next line?
there isn't one
That's python version, not whether it was built to be 64bit or 32bit
doesn't print anythin
That's not the issue. The code runs fine from the windows terminal and doesn't from inside VSCode
Open python itself (just python command), preferably in vsc, and please paste all build info.
What's under the line. On the next line I see the top of some text
Python 3.13.7 (tags/v3.13.7:bcee1c3, Aug 14 2025, 14:15:11) [MSC v.1944 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Ctrl click to launch VS Code Native REPL
"64bit (...) on win32"
There's something weird going on here
Please check whether vsc itself is 32bit or 64bit.
My guess is that somewhere in menu there should be info/version info - please find it and click it
If vsc is 32bit,thats not "config issue", but wrong install file
For vsc itself
32bit program cannot run a 64bit subprocess
That's what I've been sayijf since I joined this thread. "Maybe the vsc you have is 32-bit and therefore can't properly run python?"
would this be in a settings file or something along those lines?
No. Likely last menu on the list, last or close to last entry - from what I remember about windows' apps
No file, just literally menus on top
Are you using powershell? Can you also try typing where.exe python at the terminal?
I am using the powershell terminal inside vsc
Ok so when you run python ... from the cmd line, this is the python version it is using. Now you need to find in VSCode which python environment IT uses when running code from VSCode
Would the Details tab tell you the architecture it was built for? Or Compatibility?
See it shows two pythons.
Pip is for the c:\python one, not the windows apps one
where is the second python?
As for the pyvenv.cfg - You're checking venv config but your venv is not activated in the console
Literally two paths listed as result of where
So how do I fix it?
I don't know what his cfg file is for so I don't know if it's the SOAT (source of all truth) for VSCode's python version
On the left panel in VSCode there's a python icon at the botto of the icons. CLick on it
When I do this I see the python version VSCode is using, and I can open that and see all the installed libraries
I'm not seeing a python icon
do you mean the python version in the extention folder?
interesting I'venever seen that
Do you see the other icons?
can you right-click below the last icon? Does the popup menu have a "Python" checkmark?
can't snip it, but no it doesn not
Snip? When I right click underneath I get :
I don't get taht
I.e., click the right mouse button?
for some reason I can't take a pic, but I don't have the python option, but do have everything else I mean
Ok. Let's try something else. Do you have a "Terminal" menu?
Yes I see it and I also see you already ran pip install numpy there. But it seems to have installed it in the same environment as used by the Terminal which I don't think is the environment used by this VSCode project. Which folder is the actual VSCode project root? You have multiple folders in the browser. Is everything for this one project inside the d602-deployment.... folder? Or do you have files in PythonProject you also need?
d602-deployment just got cloned from gitlab. it was supposed to go to PythonProject/WGU
To simplify everything we should create a new VSCode project and the project root should just be that d602-deployment folder and nothing else. You are sharing folders with multiple IDEs and that is confusing for debugging
makes sense
Can you create a new VSCode project and when it asks for the project root just select your d602... folder. And if it is asking about setting up a python env show the the screen shot before you select anything
It's been a while since I used VSCode but I think you want Generate New Workspace and then I think you'll have a choice to create a new folder on disk or select an existing one.
that just opens up their AI
I could generate an empty folder on my desktop and go from there?
What comes up when you click Generate New Workspace?
that's what happens with Create Project?
yup
omg they gotta AI everything now???? Sigh. How about typing "create new project with existing folder?"
I know right
Oh mention python
create new python project with exiting folder using an existing python environment
I can't believe I'm about to say this.... but "back in my day we didn't need no fancy "AI". We just clicked "create new workspace" and it was fine."
Ok, what we really should do is create a new virtual enviroment but for numpy lots of apps use it so it's fine. You want to tell it to use C:\python for the envrionment and the full path to your d602-.... folder for the existing folder
Use C:\python for the environment and C:\Users\Donnobius Maximus\PycharmProjects\d602-deployment-task-2 for the workspace file
this?
looks good
oh wait
how about you create a folder under Donnobious Maximus\VSCodeProjects and copy the other folder there so you can keep the two IDEs separate?
thats a much better idea
should I restart the ai nonsense or can I just manually do it?
Just create the folder and copy the d602 folder over and continue with the prompt
I get that AI is flashy but this just feels like it is just making more problems to solve
do I use the VSCode_projects folder as the new workspace?
Copy the d02 folder in it and use that as the workspace for this project.Every new VSCode project should have its own workspace
And you will keep all your VSCode workspaces under this VSCode_projects folder
Perfect
so you want to select the VSCode_projects\d602... folder as the workspace folder
I did, and the bot failed ๐คฃ
OMG
yup
I tried again and got a failure message
What failed
Automatic environment selection: configure_python_environment couldn't find or select python.
It did make a few files
also thank you so much for spending your time helping me with this problem. I would have been completely lost without your help.
Ok, close all VSCode windows, go to File-> Open Folder and navigate to the d602 folder and choose that
Ok did it create the workspace?
Where's the source code files?
here we are
testing the .py file now
it gave me a popup to create a virtual environment but it went away before I could click it
I was hoping to control what env it is using for this workspace.
where is the venv? In .vscode?
It you go to Terminal now and type "which python" what does it say?
Or does it still use the windows command shell for terminal in VSCode?
as far as I'm aware there isn't a venv
I got a popup to create one but it disappeared
oooh
its still finding the c\python\python
PS C:\Users\Donnobius Maximus\VSCode_projects\d602-deployment-task-2> where.exe
python
C:\python\python.exe
ok so have you tried running the file from VSCode?
yes
and what happened?
figured out that error at least!
i'm getting a different error, but its probably becuase the file path has changed
so it didn't complain about numpy?
progress!
So that's what the issue was. You installed numpy in the "main" python env under \python, but VSCode was using a venv to run your code and that one didn't have numpy installed
oooh
so now this new project is using the main env to run the code from VSCode and all is good
looks like it!
is there anythign I should change now in order to be following best practices?
just create a new subfolder under VSCode_projects for each new project. And I think an easier way of creating a new workspace is to close all windows in VSCode, go to File -> Open Folder, choose the new project folder, then choose File -> Save Workspace As and save it into the same folder.
Thank you again!
You're welcome
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.