-3

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

  • 3
    You want numpy, not numby. – Kalpit Dec 23 '20 at 15:48
  • Be sure that you aren't using any virtual environment – emmunaf Dec 23 '20 at 15:51
  • 2
    You need to install the packages in the virtual environment that Pycharm is using or point Pycharm at the global python environment where the packages are already installed. I think Pycharm creates a new virtual environment for each new project by default. – Benjamin Hoving Dec 23 '20 at 15:52
  • 3
    This is a fairly common problem, but your question doesn't contain anywhere near enough information to tell you how to troubleshoot it. Sounds like your `pip` version belongs to a different Python version than the one you end up running, but there's like half a dozen things which could cause that. For a start, [edit] to show your `PATH` and the output of `where python` and `where pip` and ideally figure out what the discrepancy is if they are from different installations. – tripleee Dec 23 '20 at 15:55

1 Answers1

-2

This is a typical issue with python from the microsoft store. Try deleting it and downloading from python.org. Also, I have found Windows to be extremely troublesome in terms of trying to program, especially with deep learning libraries like tensorflow. I use Ubuntu for programming-related things, dualbooted with windows.