I have a python package called 'my_package'. The structure is as follows
my_package
my_package
__init__.py
__main__.py
my_package.py
some_other_file.py
run_script
setup.py
'run_script' is just a shell script that calls the package as a module using the virtual environment that is specified in the script, roughly:
#!/bin/bash
/path/to/myenv/bin/python -m my_package
'my_package' is obviously installed into myenv beforehand.
The problem is this: When the script is called, despite '-m' flag is specified, python still calls 'my_package.py' instead of importing 'my_package' from the environment.
Is there a way to override this? Somehow make it so that python doesn't use my_package.py file?
My solution would be just to rename my_package.py file. But I would hope to find something better.