Import "[module]" could not be resolved Pylance (reportMissingImports) in my Jupyter notebook while trying to run code on VS Code - pandas

I am trying to do an END-to-END project for BostonHousing on VS Code. I have installed the requirements already from requirements.txt and also chose the Python interpreter as that of my virtual environment version still the error pops like below for Jupyter notebook. The flask file is fine. Please guide me on what's wrong here.

enter link description here
you may got your answer here.check and read carefully.
Import "[module]" could not be resolvedPylance (reportMissingImports)

Related

ModuleNotFoundError : import tensorflow.compat.v1 as tf

import tensorflow.compat.v1 as tf
Error displayed in vscode
output in jupyter
Despite trying all the possible options, I am not able to fix this error.
I am trying to learn machine learning to create a simple sign language detection system. In my VSCode, the above image is displayed.
You need to follow the instructions mentioned in this link to install the tensorflow then open the VS code in the same virtual environment.
Please check these similar issues for your reference.

Conda and Jupyter Notebook Environment Confusion

I am using Jupyter Notebook to help debug some issues I'm having moving between JSON and pandas. The specific application isn't important.
The important part is that I needed to use pandas.json_normalize() which apparently first showed up in pandas version 1.0.3. I was confused when Jupyter said it doesn't exist. I did a version check and got:
In[]: pd.__version
Out[]: 0.25.2
This is not the version of python installed in either my base environment or the conda environment that Jupyter Notebook is running in or that the app is running in. Version checks in both environments in Anaconda Prompt (outside of Jupyter Notebook) confirm this.
What is going on here? Looking around I haven't seen a good answer, but it does appear that other people have had the same issue --- Jupyter defaulting to pandas 0.25.2 for some reason.
It seems that your Notebook is using a different kernel/environment than what you want.
run this in the notebook to see which environment you are using
! which python
or try
import sys
print(sys.executable)
which would show you which environment it's using, if you have env named venv then you will get something like.
/home/your_home_directory/anaconda3/envs/venv/bin/python
If you don't care about all of that and you just want to update the pandas that it's using then copy that path and do this.
! pip install --upgrade pandas
Note that this will also depend on which version of python you are using

How to compile a Python script using Tensorflow to a .exe file to be used on a computer without Python and Tensorflow

I have created a working Python script containing a Tensorflow model that can identify images. I would like to compile this script in to some form of .exe file that can be used on computers without Python and Tensorflow installed. I would appreciate any help in this regard. Which programs and versions to use, how to use them and may be some code lines to guide me.
I have without luck tried py2exe, pyinstaller and cx_freeze. Currently I am using Tensorflow 2.0 and Python 3.7.0.
Thanks in advance.
I know you said you didnt have any luck with cx_Freeze but give it a try
I made a guide here answering someone elses question

Unable to import required dependencies, Python with Pandas and Numpy

I think this question has been asked before on the internet, but the proposed solutions have so far not worked.
I am trying to run a script that imports numpy and pandas. When I run using the Python Console in my IDE (PyCharm), everything works fine. However, when I run the script from the command line, the following error is displayed:
DLL load failed: The specified module could not be found.
and
Unable to import required dependencies
I am using Anaconda Navigator. There my Pandas and Numpy are listed. I tried to uninstall them via the conda shell (conda uninstall numpy, conda uninstall pandas) and then install them again, but without result.
Hope anyone can help.
If you haven't already call this (no quotes)
conda activate "name of environment that has your modules installed"
After trial and error, I de-installed Anaconda and installed pip instead. Then I installed the modules using pip, and it worked like a charm.
(Not the most elegant answer since it does not explain why things went wrong in the first place, but it offered a workable solution at least.)

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.