O
O
okam12021-03-24 22:53:53
pip
okam1, 2021-03-24 22:53:53

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

3 answer(s)
M
Mark Chigrin, 2021-03-25
@okam1

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

M
mkone112, 2021-03-24
@mkone112

I'm starting to work on a new project.

Learn python first. Coder level question with 2 weeks of programming experience. And better check the question for spelling.

S
Sergey Karbivnichy, 2021-03-24
@hottabxp

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 question

Ask a Question

731 491 924 answers to any question