#🔒 Anyone able to help ?

71 messages · Page 1 of 1 (latest)

supple pilot
#

I have open cv installed but it’s still saying the module can’t be found

fallow nimbusBOT
#

@supple pilot

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.

nimble storm
#

!paste

fallow nimbusBOT
#
Pasting large amounts of code

So that everyone can easily read your code, you can paste it in this website:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

supple pilot
#

C:\Users\Marsh>python -c "import cv2; print(cv2.file)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
import cv2; print(cv2.file)
^^^^^^^^^^
ModuleNotFoundError: No module named 'cv2'

#

(gtuner) C:\Users\Marsh>python -c "import cv2; print(cv2.file)"
C:\Users\Marsh\miniconda3\envs\gtuner\cv2_init_.py

nimble storm
strong vault
#

are u running the code out of your conda env and only have it installed in the env?

supple pilot
#

(gtuner) C:\Users\Marsh>python -m pip install opencv-python
Requirement already satisfied: opencv-python in c:\users\marsh\miniconda3\envs\gtuner\lib\site-packages (4.5.5.64)
Requirement already satisfied: numpy>=1.14.5 in c:\users\marsh\miniconda3\envs\gtuner\lib\site-packages (from opencv-python) (1.24.4)

strong vault
#

but when you run the code are you running it in the gtuner conda env?

nimble storm
#

@strong vault you are now the official answerer for this channel, as I don't know how to help with conda issues.

strong vault
#

no problem I use miniconda so I should hopefully be able to help

#

@supple pilot lmk if you are running the code within your conda environment or not

supple pilot
#

But it’s definitely installedmy bad I’m dealing with my kids one sec

strong vault
#

no problem. but a library can be installed within your miniconda environment however if you run code outside of the environment (interpreter isnt pointed to it) then it wont use your library

supple pilot
#

How can I check to see if I’m running it from the env

strong vault
#

are you using vscode?

supple pilot
#

I see the env folder

strong vault
#

how are you running your file? through vscode or some otehr ide or from your terminal?

supple pilot
#

I’m running it from the anaconda terminal

#

But it’s all there ,but Gtuner keeps saying the module can’t be found

strong vault
#

try running where python and conda list opencv and send the output.

also when you run ur file do you see the (gtuner) prefix?

supple pilot
strong vault
#

can u run ur file in that terminal and send that output too

supple pilot
#

If you don’t mind , how could I do that ? I’m not that advanced like you 😭😭

strong vault
#

how were you running your file before, did you run it elsewhere?

supple pilot
#

Yes I was running it though Gtuner I put the file location so it can find python and open cv module. But it’s only finding python not open cv

strong vault
# supple pilot

in this terminal try running your file by doing python yourfilename.py replacing "yourfilename" with the acc name of your file and see if it runs there

#

and send the output

strong vault
# supple pilot

because from what I see here cv2 is installed in your gtuner environment so it must be something to do with how you are running your script

supple pilot
#

I believe I wrote is in miniconda3

#

See I don’t think I got it set up right 😭😭

#

Yeah I believe Gtuner just can’t find the file , because it’s there

strong vault
#

but that is the libraries file you dont run that. You write your own code and import the library into your own file and run that not the acc library files

supple pilot
#

Ah okay 😭😭 okay let me try to learn a bit more

strong vault
#

you can always make another thread to ask more questions as well!

supple pilot
#

have you tried gtuner before ?

strong vault
#

is that not the name of your conda environment or is it something else I'm missing?

supple pilot
#

Gtuner is a tool , I’m asking because it’s not really known

strong vault
#

ah yea no I have not

supple pilot
#

It looks like this

strong vault
#

ah gotchu

supple pilot
#

Yeah , I’m just confused on why it’s not finding the module if it’s all in the files

strong vault
#

and see if that makes a difference

#

because in your earlier screen shots I can clearly see that the mini conda enviornment can find the library so its gtuner being a bit weird

#

you might also just have to restart gtuner after u select the exe

supple pilot
#

Yeah I agree ts definitely being weird

strong vault
#

it wont be a folder

#

try scrolling down in there and see if u can find a file called python.exe and if it lets u select it

#

if it wont let u pick the acc file just click on the gtuner folder and try that and restart

supple pilot
#

I know what it is , it’s just Gtuner isn’t allowing me to go to it

modern nexus
#

Why are you using python 3.8?

#

Upgrade to at least 3.10

strong vault
#

because your conda enviornment can see opencv try to maybe uninstall and reinstall the library and restart gtuner just to troubleshoot

strong vault
supple pilot
supple pilot
strong vault
#

ah well there u go

#

but yea everything else does seem to be working perfectly fine so no problem there

supple pilot
#

Yeah I appreciate the help

strong vault
#

no problem

fallow nimbusBOT
#
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.