Problem in using libraries

Thomas Passin list1 at tompassin.net
Mon Apr 3 13:25:48 EDT 2023


On 4/3/2023 12:43 PM, Pranav Bhardwaj wrote:
> Why can't I able to use python libraries such as numpy, nudenet, playsound,
> pandas, etc in my python 3.11.2. It always through the error "import
> 'numpy' or any other libraries could not be resolved".

You need to realize that no one can help you without some specific 
information.  You have not told us anything.  You might as well have 
said, if your car didn't start, "My car won't run.  Why can't I start it?.

Let's start with the most obvious thing - are those libraries installed? 
  If not, install them.  If you think they have been installed, then 
tell us how you installed them and how you know they have been 
successfully installed *for the version of python* you are trying to use.

Let's take numpy. The standard way to install it is using pip.  You have 
to make sure that you run the pip program that goes with the version of 
Python you plan to use.  I'm going to assume that if you type "py" 
(without quotes), you will get that version.  If not, use the command 
you have been using to run Python 3.11.

On my system:

C:\Users\tom>py -V
Python 3.10.9

C:\Users\tom>py -m pip show numpy
Name: numpy
Version: 1.23.4
Summary: NumPy is the fundamental package for array computing with Python.
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email:
License: BSD
Location: 
c:\users\tom\appdata\local\programs\python\python310\lib\site-packages
Requires:
Required-by: bokeh, causal-curve, cftime, contourpy, csaps, dcor, emd, 
frechetdist, imageio, localreg, matplotlib, mizani, netCDF4, numba, 
pandas, patsy, plotnine, pwlf, pyDOE, pygam, PyWavelets, scaleogram, 
scikit-image, scikit-learn, scipy, seaborn, sparse, statsforecast, 
statsmodels, tifffile

If a library is not installed (I'll use a non-existent library name) -

C:\Users\tom>py -m pip show numpyx
WARNING: Package(s) not found: numpyx

To install numpy with pip *for that version of Python* -

py -m pip install numpy   (or a form you may see sometimes: py -m 
install --user numpy)

Please reply with this information.


More information about the Python-list mailing list