Answer the question
In order to leave comments, you need to log in
How to work with libraries in Python?
I'll give an example.
I'm starting to work on a new project. And there I need other libraries. Suppose that I created a new folder PROJECT in which there will be 1 module MY_MODULE.PY and the main launch file RUN.PY
, and when I try to connect the file MY_MODULE.PY to RUN.PY, the interpreter does not see it, but it sees all those libraries that I installed with past project (via pip).
Answer the question
In order to leave comments, you need to log in
For each project in python, a separate virtual environment is created, where all dependencies and the required version of python are placed.
The most convenient way to work with this is with the help of utilities for building, managing dependencies, etc. I prefer poetry .
You can just use venv, but it's not that convenient.
It is also possible that you have problems due to incorrect creation of modules, imports or names (it is better not to name modules the same as standard ones)
Read the documentation , you may find an error
I'm starting to work on a new project.
Change the file extension to lower case. For example, so MY_MODULE.py
And read pep8.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question