Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poor portability of sys.path.append in assignment modules #103

Open
beanbrainbb opened this issue May 29, 2020 · 3 comments
Open

poor portability of sys.path.append in assignment modules #103

beanbrainbb opened this issue May 29, 2020 · 3 comments

Comments

@beanbrainbb
Copy link

Just starting the course, here. I found that the sys.path.append calls in the assignment modules fail silently. A quick stack overflow search returned this

consider using sys.path.dirname instead?

I'd refactor this and submit a pull request but I'm so tired, I don't even know what day it is now.

@m3m0ry
Copy link

m3m0ry commented Mar 20, 2021

The correct approach would be to use pathlib

@josiasmat
Copy link

josiasmat commented Apr 16, 2023

I replaced sys.path.append('../../software/models') by sys.path.append(os.path.join('..','..','software','models')).
pathlib is new to Python 3.4, so users of older Python versions would not be able to use it (although Python 3.4 is not new anymore by any measure).

@egndz
Copy link

egndz commented Jan 21, 2024

Instead of adding the libraries using sys.path, how about creating a package with setup.py(deprecated tho) or pyproject.toml file for software and importing them e.g. from software.modules import harmonicModel as HM.

I am new to the repo, it is a suggestion and happy to discuss them in detail 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants