Hi @Caroline @Franky1, I changed ‘psycopg2’ to ‘psycopg2-binary’ in my requirements.txt and solved the problem. Thanks for your reply :smiley: Answer from Vika on discuss.streamlit.io
🌐
Streamlit
discuss.streamlit.io › community cloud
Import "psycopg2" could not be resolved from source Pylance - Community Cloud - Streamlit
March 11, 2024 - My app works locally, but when I deploy it in github codespace, it will return the following message (*I already add psycopg2 and pingouin in requirement.txt): [{ “resource”: “/workspaces/ppm-automation-test/pages/Hel…
🌐
Stack Overflow
stackoverflow.com › questions › 71168304 › psycopg2-error-missingmodulesource-but-the-module-is-installed
python - Psycopg2 Error MissingModuleSource but the module is installed - Stack Overflow
February 18, 2022 - I am trying to connect to PostgresSql in python using psycopg2. I ran the following in my VS-Code and Mac terminal: ... It says that the requirement is already satisfied. Yet, when I go to import psycopg2 I get the following error:
Discussions

python - ImportError: No module named psycopg2 - Stack Overflow
In installation process of OpenERP 6, I want to generate a config file with these commands: cd /home/openerp/openerp-server/bin/ ./openerp-server.py -s --stop-after-init -c /home/openerp/openerp-s... More on stackoverflow.com
🌐 stackoverflow.com
python - Error: No module named psycopg2.extensions - Stack Overflow
I am trying to set up a PostgreSQL database for my django project, which I believe I have done now thanks to the replies to my last question Problems setting up a postgreSQL database for a django p... More on stackoverflow.com
🌐 stackoverflow.com
Error loading psycopg2 module: No module named 'psycopg2'
Hi all, First of all, I've read all the posts I could find about this problem to no avail :( I've got an up&running default webapp with python3 and django already working with default d... More on github.com
🌐 github.com
9
May 26, 2021
Pylance seems to forget the selected interpreter after a (short) while: reportMissingImports
Environment data Language Server version: 2023.7.20 VS Code with Remote-SSH Remote OS and version: ubuntu linux 22.04 Python version: 3.11.4 installed with pyenv python.analysis.indexing: true pyth... More on github.com
🌐 github.com
14
July 14, 2023
🌐
Python Forum
python-forum.io › thread-34556.html
Psycopg2 doesn't work with python2
Recentley i installed psycopg2 2.9 version and tried to connect it with python2.7 but nothing doesn't work ,my VS Code sends me an error:Import 'psycopg2' could not be resolved from sourcePylancereportMissingModuleSource.How can i fix this?
🌐
YouTube
youtube.com › watch
python ImportError: No module named psycopg2 - YouTube
python ImportError: No module named psycopg2sudo apt-get install python-psycopg2sudo pip install psycopg2Python Tutorials : https://www.facebook.com/PythonTu...
Published   May 1, 2017
🌐
Bobby Hadz
bobbyhadz.com › blog › python-no-module-named-psycopg2
ModuleNotFoundError: No module named 'psycopg2' in Python | bobbyhadz
April 8, 2024 - To solve the error, install the module by running the pip install psycopg2-binary command. Open your terminal in your project's root directory and install the psycopg2-binary module.
Find elsewhere
🌐
GitHub
github.com › psycopg › psycopg2 › issues › 1282
Error loading psycopg2 module: No module named 'psycopg2' · Issue #1282 · psycopg/psycopg2
May 26, 2021 - 'ENGINE': 'django.db.backends.postgresql_psycopg2', and it failed. Then, from some youtube videos, I tried: ... (env) PS D:\Users\llagos.NB-KEYONE15\Visual Studio projects\ecommerce-psql> python manage.py makemigrations Traceback (most recent call last): File "D:\Users\llagos.NB-KEYONE15\Visual Studio projects\ecommerce-psql\env\lib\site-packages\django\db\backends\postgresql\base.py", line 25, in import psycopg2 as Database ModuleNotFoundError: No module named 'psycopg2' ...
Published   May 26, 2021
Author   llagos
🌐
Appassionatitalia
mgws.appassionatitalia.it › page › bmtb
import pandas could not be resolved from sourcepylancereportmissingmodulesource
Import "decouple" could not be resolved. Pandas Profiling. import pandas as pd Wait, before that ensure if you have downloaded the pandas in your machine. You can query them as you would any regular SQL table. Most people prefer this import: import pandas as pd. pandas import from csv. With Pandas, there's a good way to analyze a complete MongoDB collection's data based on an API call. Recentley i installed psycopg2 2.9 version and tried to connect it with python2.7 but nothing doesn't work ,my VS Code sends me an error:Import "psycopg2" could not be resolved from sourcePylancerepor.
🌐
MLJAR
mljar.com › modulenotfounderror › no-module-named-psycopg2
No module named psycopg2
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 1 ----> 1 import psycopg2 ModuleNotFoundError: No module named 'psycopg2' Don't worry. We will fix the issue. You need to install missing package. We ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-fix-modulenotfounderror-no-module-named-psycopg2-in-python
How to Fix 'ModuleNotFoundError: No Module Named psycopg2' in Python - GeeksforGeeks
July 23, 2025 - ... Below, are the approaches to solve “Modulenotfounderror: No Module Named ‘psycopg2′”. We can resolve this error by installing the psycopg2 package externally using the PIP.
🌐
Psycopg
psycopg.org › docs › install.html
Installation — Psycopg 2.9.12 documentation
The libpq header files used to compile psycopg2 should match the version of the library linked at runtime. If you get errors about missing or mismatching libraries when importing psycopg2 check (e.g.
🌐
GitHub
github.com › spyder-ide › spyder › issues › 21228
Unable to import psycopg2 due to mixing packages from different Python installations · Issue #21228 · spyder-ide/spyder
August 7, 2023 - #if you have installed psycopg2-binary import psycopg2 File ~/Library/Python/3.9/lib/python/site-packages/psycopg2/__init__.py:51 from psycopg2._psycopg import ( # noqa ImportError: dlopen(/Users/my_username/Library/Python/3.9/lib/python/site-packages/psycopg2/_psycopg.cpython-39-darwin.so, 0x0002): tried: '/Users/my_username/Library/Python/3.9/lib/python/site-packages/psycopg2/_psycopg.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/my_username/Library/Python/3.9/lib/python/site-packages/psycop
Author   travisstenerson-concert
🌐
GitHub
github.com › microsoft › pylance-release › issues › 4762
[Bug] Incorrect reportShadowedImports on Python 3.10 venv and override · Issue #4762 · microsoft/pylance-release
August 25, 2023 - Environment data Language Server version: 2023.8.40 OS and version: darwin arm64 Python version (and distribution if applicable, e.g. Anaconda): 3.10.11 (pyenv) python.analysis.indexing: true python.analysis.typeCheckingMode: off Code Sn...
Author   watfordkcf
🌐
GitHub
github.com › microsoft › pylance-release › issues › 7659
Pylance doesn't recognize installed modules · Issue #7659 · microsoft/pylance-release
October 21, 2025 - Type: Bug I have the following code: from pathlib import Path import polars as pl import yaml # rest of the code Pylance reports two errors: Import "polars" could not be resolved Pylance(reportMissingImports) Import "yaml" could not be r...
Author   fsalinash
🌐
Django Forum
forum.djangoproject.com › using django › mystery errors
Psycopg will not work - Mystery Errors
December 26, 2023 - I have tried to uninstall psycopg[binary] and uninstall django. Than I have tried to reinstall using pip install psycopg, pip install psycopg[binary, pip install psycopg2[binary] and of course pip install django · I have checked the psycopg documentation and I am in line with what they ask ...