I have installed multiple modules using pip but I can't access any of them. I can check and see that the modules are installed using pip list, but when I try to access them in python I just get ModuleNotFoundError no matter what. I can't find any help anywhere online and honestly just want to stop learning python because I have so many problems like this every day.

            Asked
            
        
        
            Active
            
        
            Viewed 64 times
        
    0
            
            
        - 
                    1Which operating system are you using? Which environment manager (`conda`, `pipenv`, ...) are you using? What did you try so far? – Darius Mar 14 '21 at 22:47
- 
                    2So how are you trying to import them? Please add example code to your question of how you're trying to import the modules and what the exact error is. – MatsLindh Mar 14 '21 at 22:47
2 Answers
1
            
            
        There seemed to be two different locations python was installed to. Problem solved by moving f2py.exe to the proper location and setting the proper PATH locations.
 
    
    
        OGwalrus
        
- 11
- 1
- 
                    1as a rule of thumb to enjoy coding with python and make your dev env match the prod env, always use virtual environments and never the system's python. – DevLounge Mar 14 '21 at 23:45
0
            
            
        Don't give up! Python is great. I think you've installed the modules in an environment which might not be the same your code uses at runtime.
At the top of your code try to add:
import sys
print(sys.path)
You might notice that your code uses another location.
 
    
    
        DevLounge
        
- 8,313
- 3
- 31
- 44
- 
                    It seems like the modules are being installed to the directory 'appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages' when maybe they should be installing to 'AppData\Local\Programs\Python\Python39\Lib\site-packages'. How can I change the directory that pip installs to? – OGwalrus Mar 14 '21 at 23:08
