Import of libraries could not be resolved - numpy

I installed all the libraries below but when I am running the code, I get the error saying "Import 'numpy' could not be resolved. The same applies to all the libraries. What did I do wrong?

Related

Cannot import Tensorflow

I can't import tensorflow, even after checking all dependencies. I'm getting an error message 'ModuleNotFoundError: No module named 'tensorflow'' when importing 'import tensorflow as tf' in vs code
I installed tensorflow through conda with 'conda install tensorflow'. It seems to have worked, since when I use 'pip show tensorflow', it shows up as 'version 2.10.0'. Moreover, my Python version is '3.9.15', so it should be compatible. I've been looking all over and no other installatoins have been working. Any suggestions?
Please try again by using Python version 3.10 as Python 3.9 shows some version errors in VS code.
Please check this link to install TensorFlow in VScode.

import matplotlib fails with DLL load error but only in spyder

I am using miniconda. Spyder is installed in the base environment and configured with spyder_kernels to point to the interpreter in my work environment called py37. That is where numpy, pandas and matplotlib are installed.
When I activate py37 in a command prompt and use python there I can use matplotlib in my scripts without incident.
When I attempt to run the same scripts from spyder, I get this DLL import error:
File "C:\Users\eli\miniconda3\envs\py37\lib\site-packages\matplotlib\__init__.py", line 190, in _check_versions
from . import ft2font
ImportError: DLL load failed: The specified module could not be found.
Can someone tell me how to diagnose this issue further? It seems like it is trying to import from the correct environment. import numpy and import pandas do work (both are only installed in py37, not base). Is this some sort of interference from the base environment? I'm aware I could install spyder in the py37 environment, but I like the spyder-kernels idea because it would keep the working environment simpler ... if I can get it to work.
It appears that this issue requires an upgrade on the Spyder and Spyder-kernel side and/or an environmental variable be set on the Windows side.
On the Spyder side, there is an improvement in the release candidate version (4.0.0rc2) with the most up-to-date python and spyder-kernels > 1.8. These had to be installed from the spyder-ide channel.
Then for me it still didn't work because an old DLL search path issue. I had to set this environmental variable which takes one system directory out of the search path for Anaconda:
CONDA_DLL_SEARCH_MODIFICATION_ENABLE to 1
On my system, I think it might have been interesting to try only this latter change.
My gratitude to the spyder developers. This took several iterations.

Problems with importing PyQt5 modules, the programs crashes: Process finished with exit code -1073741819 (0xC0000005)

Even if I create a file with this only line:
from PyQt5 import QtCore
it crashes and gives me the error I reported in the title. This didn't happen before today, and I don't get why. I'm using PyCharm and I installed PyQt5 via its Settings-->Project: Project_Name-->Project interpreter
Can someone argue what's happening?
SOLVED:
Just uninstalled and re-installed PyCharm

Tensorflow on Anaconda error cannot find cudnn64_6.dll

I am having a problem with Tensorflow running on Spyder. When I installed it in cmd, it had the same problem that it couldn't find the path to cudnn64_6.dll, and so I added pathway to it and it seemed to import. Then, I installed the theano library and the keras and it seemed ok, then when I tried to import the keras library in spider, I got this message:
I have Cuda v8.0 and it should have that with it, at least I am told. I have installed all the drivers and downloaded the cudnn v6.0 for Cuda 8.0 and have added enough paths but still no luck. Where have I gone wrong?
Its Ok I just had to get rid of some environment paths and restart. My bad

On win7 when import tensoreflow it shows "no module named_pywrap_tensorflow" after i do use the vc_redist

the redist(x86) is different from those answers provided before(x64).Is that the point?
Meanwhile it shows "Unless you are using bazel, you should try to import tensorflow from its source directory".But i didn't do that.
Ensure that you have Visual Studio Installed and that MSVCP140.DLL is on your computer AND in your PATH envVar. You shouldn't be building from source on Windows as it is not supported. I assume that you installed via pip?
Check for the DLL, VS, your PATH variables and, if that doesn't work, redownload the vc_redist_x64 version.
Failing that, uninstall Tensorflow and try again with pip install tensorflow or from a nightly. I had a similar issue and starting fresh seemed to help.