Python Forum

Full Version: Import error with local file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello. When I try to run a python file
python optimizer.py
it says
ImportError: No module named optimizers.PSO
There is a file called "PSO.py" on the folder "optimizers", that happens to be on the same directory where "optimizer.py" it is:

So, it is all about showing python this PSO.py? If yes, how can I do that? Many thanks
Try python -m optimizers.optimizer perhaps.