I created a python package in our gitlab repo. (We are using vagrant as virtual machine, just fyi)
The package is called “simulation” and contains a setup.py, simulation.py, init.py and main.py file. In the simulation directory, i call “pip install -e .” which calls the setup.py and installs my package. This should be global accessable now.
To test accessability, i write some output from simulation.py (“init” and “run”).
When I call “python -m simulation” in /vagrant, (where the simulation folder is located next to some other folders), the output is plotted →
When i call the package in a directory, f.e. /vagrant/tools, then I see no output, but also no error. Thats the problem with this created package. I hope you can give me an advice, would be great.
Thanks and best regards!
import setuptools from setuptools import setup setup(name='simulation', version='0.0.0', description='Simulation environment', url='', author='', author_email='', license='', packages=setuptools.find_packages(), include_package_data=True, zip_safe=False)
import os from os import remove from time import sleep run = True class Simulation: def __init__(self, args, launch_lat, launch_lon, launch_alt_asl): self.args = args self.launch_lat = launch_lat self.launch_lon = launch_lon self.launch_alt_asl = launch_alt_asl print("init") def run(self): print("hello")
from os import path from simulation import Simulation args = 0 launch_lat = 0 launch_lon = 0 launch_alt_asl = 0 simulation = Simulation(args, launch_lat, launch_lon, launch_alt_asl) simulation.run()
from .simulation import Simulation