I’ve finished a beginner course and just started a second course for Python. I am using Python 3.9
I am having troubles working with imported modules… So I experimented with it and all worked fine, I did have trouble finding the modules I installed trough pip because the course was for 3.6 and it seemed to be in a different location on 3.9 (or is this my setup?). Anyways in the end I found it and the course was completed with succes.
Now however I wanted to try making my own little program using a module I found on Github: GitHub - openfoodfacts/openfoodfacts-python: Python package for Open Food Facts
Now first of all I don’t even know if I want to use this module but I wanted to check it out.
I can’t get it to work at all… So I installed it trough pip and I can find the folder with the .py and .pyc files in this location on my pc: /home/minty/.local/lib/python2.7/site-packages/openfoodfacts
This seems to be for Python version 2.7
When I try to use the import command for one of the files in the folder I ofcourse get this error: ModuleNotFoundError: No module named ‘products’
I can not find the module inside Python anywhere, only on my pc in that folder.
So the question is: how can I simply add a folder location in Python as a usable module folder?
Can this be done/used if the module is made for an older version of Python? Or do I have to start my project in Python 2?
I found some answers on the internet so far but as a newbie this makes no sense to me at all, its complicated code after a simple beginner’s course and when I copy it it still does not work. (changing the .sys directory, tried it; does not work) So can anyone please explain to me in very simple language what the problem is?? Am I overlooking a button where I can simply add this folder, or is this really complicated stuff that is just out of my league for now?? I must say in the tutorial it seemed that in python 3.6 the imported modules were easyer to find, but that might just be me who just does not get all the folders and subfolders functions yet…
Also: I tried opening the .py files and they open in Python 3.9, so I tried copying the codes in new files that I can simply find in the left panel thinking I was being smart: BUT: this gives me lots of errors so I guess this is not the way to go: why is this? does it have to do with the .pyc files?
In other words: I have no idea what I’m doing and I would like not having to quit this project before starting/learning way too much about modules in the beginning for something that seems like a simple problem…