when I pip install any python package and then run it in pycharm as follow:
import requests
from bs4 import beautifulsoup
import pandas
import numpy
it always displays this error:
No module named requests
Unresolved reference 'bs4'
Unresolved reference 'beautifulsoup'
No module named pandas
No module named numpy
and it is really annoying because I can't use any python modules and also I don't have more than one python on my pc and when I search in the following directory which pip install packages there by default I find the modules but still can't use them.
C:\Users\sony vaio 2012\AppData\Local\Programs\Python\Python39\Lib\site-packages
I also checked where python is using 'where' command in cmd:
C:\Users\sony vaio 2012>where python
C:\Users\sony vaio 2012\AppData\Local\Programs\Python\Python39\python.exe
C:\Users\sony vaio 2012\AppData\Local\Microsoft\WindowsApps\python.exe
and that's where pip is:
C:\Users\sony vaio 2012>where python
C:\Users\sony vaio 2012\AppData\Local\Programs\Python\Python39\python.exe
C:\Users\sony vaio 2012\AppData\Local\Microsoft\WindowsApps\python.exe
path in cmd:
C:\Users\sony vaio 2012>python
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', 'C:\\Users\\sony vaio 2012\\AppData\\Local\\Programs\\Python\\Python39\\python39.zip', 'C:\\Users\\sony vaio 2012\\AppData\\Local\\Programs\\Python\\Python39\\DLLs', 'C:\\Users\\sony vaio 2012\\AppData\\Local\\Programs\\Python\\Python39\\lib', 'C:\\Users\\sony vaio 2012\\AppData\\Local\\Programs\\Python\\Python39', 'C:\\Users\\sony vaio 2012\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages']
>>>
path in jupyter notebook:
['C:\\Users\\sony vaio 2012',
'c:\\users\\sony vaio 2012\\appdata\\local\\programs\\python\\python39\\python39.zip',
'c:\\users\\sony vaio 2012\\appdata\\local\\programs\\python\\python39\\DLLs',
'c:\\users\\sony vaio 2012\\appdata\\local\\programs\\python\\python39\\lib',
'c:\\users\\sony vaio 2012\\appdata\\local\\programs\\python\\python39',
'',
'c:\\users\\sony vaio 2012\\appdata\\local\\programs\\python\\python39\\lib\\site-packages',
'c:\\users\\sony vaio 2012\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\win32',
'c:\\users\\sony vaio 2012\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\win32\\lib',
'c:\\users\\sony vaio 2012\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\Pythonwin',
'c:\\users\\sony vaio 2012\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\IPython\\extensions',
'C:\\Users\\sony vaio 2012\\.ipython']
pip version:
C:\Users\sony vaio 2012>pip --version
pip 20.3.3 from c:\users\sony vaio 2012\appdata\local\programs\python\python39\lib\site-packages\pip (python 3.9)
I am a beginner btw and I use python 3.9.1 on windows 10