Answer the question
In order to leave comments, you need to log in
How to run python application in linux?
There is a Web server project in pycharm which has the following structure
[WebServer]
---- config.py
---- [app]
-------- __init__.py
-------- ...
-------- ...
Traceback (most recent call last):
File "__init__.py", line 5, in
from config import Config
ModuleNotFoundError: No module named 'config'
Traceback (most recent call last):
File "__init__.py", line 16, in
from app import routes, api, models
ModuleNotFoundError: No module named 'app'
Answer the question
In order to leave comments, you need to log in
Because these modules are not in PYTHONPATH, you need to sit down once, read the docs and figure out how to do everything right https://docs.python.org/3/tutorial/modules.html#th... and maybe for a deeper dive into topic https://docs.python.org/3/reference/import.html#th...
Perhaps in pycharm you are using an environment (venv) in which some modules are installed that were installed, for example, via pip install. In order for your project to work successfully, you need to create the same environment for it in Linux. To see what is installed in pycharm in the terminal, type: pip freeze - a list of installed packages will appear. also on linux try this command (must have pip installed) and compare the packages. If not, you'll have to dig deeper.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question