#๐Ÿ”’ error preventing pandas/numpy from working

231 messages ยท Page 1 of 1 (latest)

honest anchor
#

ImportError: Unable to import required dependencies:
numpy:

eternal dockBOT
#

@honest anchor

Python help channel opened

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.

honest anchor
#

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?)

hoary timber
#

have you actually installed numpy into your python environment?

honest anchor
#

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)

hoary timber
#

pip should work

honest anchor
#

I think I just checked the version I'm using

hoary timber
#

have you verified that the python environment you are using to run the code is the same one that you installed numpy into?

honest anchor
#

no, how would I do that?

#

I know PATH exists, but thats the extent of my knowledge

hoary timber
#

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?

honest anchor
#

the picture I shared is the only output

honest anchor
hoary timber
#

what happens if you run it from the terminal?

honest anchor
#

good question

#

I tried the python3 command and it opened a microsoft store page to download python?

hoary timber
#

what if you run python --version from the cmd line?

honest anchor
#

3.13.7

hoary timber
#

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>

honest anchor
#

no such file or directory

hoary timber
#

also, your working dir should be the project root. If the file is nested you need to give the relative path from that root

honest anchor
#

ls didn't pull up the files in the directory?

#

or is that bash and not command prompt?

hoary timber
#

well it looks like you're in a simple windows terminal

honest anchor
#

thats why I'm asking if ls is not a command that works

hoary timber
#

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

honest anchor
#

(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)

hoary timber
#

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

honest anchor
hoary timber
#

What's the panel to the left that's cut off?

honest anchor
#

just where I am in the PC

hoary timber
#

Aren't you running it from inside VSCode?

honest anchor
#

yes

#

I'm runnign the code from vs code

#

I'm sending you screenshots of my file explorer

hoary timber
#

What is the project root, and what is the structure from that root to the file you are trying to run?

honest anchor
#

PycharmProjects is the root

hoary timber
#

show me the screenshot from VSCode

honest anchor
#

I tried moving the gitrepo to PythonProject and got an error

hoary timber
#

getting warmer

#

keep going until the file you are trying to run is also shown

#

You're using VSCode with a PyCharm project?

honest anchor
honest anchor
#

also tried this .py file

hoary timber
#

Is the whole app in just one .py file?

honest anchor
#

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?

hoary timber
#

And we're looking at a panel from VSCode right?

honest anchor
#

yes

hoary timber
#

ok so from the terminal navigate to that d602... directory then type python <file name>

honest anchor
#

it ran

#

it just imports a file and returns a df.head()

hoary timber
#

so that means numpy is correctly installed in this python env. Are you sure you're using the same environment in VSCode?

honest anchor
#

I thought I was

#

I selected the root as the folder I'm working in

hoary timber
#

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

worldly orchid
honest anchor
honest anchor
hoary timber
honest anchor
#

there isn't one

worldly orchid
honest anchor
hoary timber
#

That's not the issue. The code runs fine from the windows terminal and doesn't from inside VSCode

worldly orchid
#

Open python itself (just python command), preferably in vsc, and please paste all build info.

hoary timber
honest anchor
#

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

worldly orchid
#

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

hoary timber
#

It's just a VSCode config issue

#

python and his app run fine from the terminal.

worldly orchid
#

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?"

honest anchor
worldly orchid
#

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

honest anchor
worldly orchid
#

This is file properties

#

Not menu in the app

#

Open vsc

hoary timber
#

Are you using powershell? Can you also try typing where.exe python at the terminal?

honest anchor
honest anchor
#

I am using the powershell terminal inside vsc

hoary timber
#

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

hoary timber
honest anchor
#

I think this is right?

worldly orchid
# honest anchor

See it shows two pythons.
Pip is for the c:\python one, not the windows apps one

honest anchor
#

where is the second python?

worldly orchid
# honest anchor

As for the pyvenv.cfg - You're checking venv config but your venv is not activated in the console

worldly orchid
honest anchor
#

So how do I fix it?

hoary timber
# honest anchor

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

honest anchor
#

I'm not seeing a python icon

honest anchor
hoary timber
#

Bottom Left?

honest anchor
#

interesting I'venever seen that

hoary timber
#

Do you see the other icons?

honest anchor
hoary timber
#

can you right-click below the last icon? Does the popup menu have a "Python" checkmark?

honest anchor
#

can't snip it, but no it doesn not

hoary timber
#

Snip? When I right click underneath I get :

honest anchor
#

I don't get taht

hoary timber
#

I.e., click the right mouse button?

honest anchor
#

for some reason I can't take a pic, but I don't have the python option, but do have everything else I mean

hoary timber
#

Ok. Let's try something else. Do you have a "Terminal" menu?

honest anchor
#

Yes

#

do you mean the terminal on the bottom pane of vsc?

hoary timber
#

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?

honest anchor
#

d602-deployment just got cloned from gitlab. it was supposed to go to PythonProject/WGU

hoary timber
#

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

honest anchor
#

makes sense

hoary timber
#

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

honest anchor
#

so re-clone my gitlab folder here?

hoary timber
#

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.

honest anchor
#

that just opens up their AI

#

I could generate an empty folder on my desktop and go from there?

hoary timber
#

What comes up when you click Generate New Workspace?

honest anchor
#

the right panel "build with agent"

hoary timber
#

Try clicking create project

#

and paste screenshot

honest anchor
hoary timber
#

that's what happens with Create Project?

honest anchor
#

yup

hoary timber
#

omg they gotta AI everything now???? Sigh. How about typing "create new project with existing folder?"

honest anchor
#

I know right

hoary timber
#

Oh mention python

honest anchor
#

this?

hoary timber
#

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."

honest anchor
hoary timber
#

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

honest anchor
#

this?

hoary timber
#

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?

honest anchor
#

thats a much better idea

#

should I restart the ai nonsense or can I just manually do it?

hoary timber
#

Just create the folder and copy the d602 folder over and continue with the prompt

honest anchor
#

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?

hoary timber
#

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

honest anchor
#

Perfect

hoary timber
#

so you want to select the VSCode_projects\d602... folder as the workspace folder

honest anchor
#

I did, and the bot failed ๐Ÿคฃ

hoary timber
#

OMG

honest anchor
#

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.

hoary timber
#

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?

honest anchor
honest anchor
#

testing the .py file now

#

it gave me a popup to create a virtual environment but it went away before I could click it

hoary timber
#

I was hoping to control what env it is using for this workspace.

honest anchor
#

isn't that waht a .venv does?

#

or do I have that wrong?

hoary timber
#

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?

honest anchor
honest anchor
#

I got a popup to create one but it disappeared

hoary timber
#

ok so type where.exe python

#

oh you did

honest anchor
#

yup

#

and it didn't return anythin

hoary timber
#

oh it's "where.exe" python

#

not python.exe

honest anchor
#

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

hoary timber
#

is it showning 2 though?

#

or just 1?

honest anchor
hoary timber
#

ok so have you tried running the file from VSCode?

honest anchor
#

yes

hoary timber
#

and what happened?

honest anchor
#

figured out that error at least!

#

i'm getting a different error, but its probably becuase the file path has changed

hoary timber
#

so it didn't complain about numpy?

honest anchor
#

no it did not

#

it ran!

hoary timber
#

progress!

honest anchor
#

we are at the same point as running it in the terminal!

hoary timber
#

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

honest anchor
#

oooh

hoary timber
#

so now this new project is using the main env to run the code from VSCode and all is good

honest anchor
#

looks like it!

#

is there anythign I should change now in order to be following best practices?

hoary timber
#

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.

honest anchor
#

Thank you again!

hoary timber
#

You're welcome

eternal dockBOT
#
Python help channel closed for inactivity

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.