Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't import a package installed in anaconda

enter image description hereI have a simple question. I have install resampy using anaconda

conda install -c conda-forge resampy

Now when I import resampy into my python program, it still returns the error saying Import Error: No module named resampy But conda says it is installed. Can someone help me out where I'm doing something wrong? The major confusion that I come across is: When I install a package using anaconda, does it install just like any other package installed via pip? Can I import and use it just like any other package?
Please someone help me out of this.

like image 255
Tauseef_Ahmed Avatar asked Jan 24 '26 15:01

Tauseef_Ahmed


1 Answers

I have the same experience, somehow in the PATHs that Anaconda created, it does not include the full path to the package installed via conda install.

As workaround, i use:

import sys sys.append(full path to the site-package directory)

in my case: sys.path.append("C:/Users/rpo/AppData/Local/conda/conda/envs/tweet/Lib/site-packages/")

I experienced this for one package in both linux and windows conda environment, i guess could be package specific issue.

like image 95
r poon Avatar answered Jan 27 '26 07:01

r poon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!